Library tutorials & articles

Simple DOM Access

Client Code

<script src="sda.js" language="javascript1.1" > </script>

The developer inserts a javascript tag and a function called load_data() The load_data function accesses the Simple DOM Access package allowing the developer to add nodes and associate attributes to the node element.

<script language="javascript1.1">

functionload_data() {

var oRootNode;

oRootNode=getSimpleDOMAccessDocument().selectSingleNode("/xml/node");

sda.addNode("root","A","1"); sda.setAttribute("A","message","Hello World"); /* sda.removeAttribute("A","message"); */ sda.addNode("A","AA","2"); sda.addNode("AA","AA1","3"); sda.addNode("AA","AA2","4"); sda.addNode("AA","AA3","5"); sda.addNode("A","AB","6"); sda.addNode("AB","AB1","7"); sda.addNode("AB","AB2","8"); sda.addNode("AB","AB3","9"); sda.addNode("root","B","10"); sda.addNode("B","BA1","11"); sda.addNode("B","BA2","12"); sda.addNode("B","BA3","13"); sda.addNode("B","BA4","14"); /* sda.deleteNode("AA3"); */

sda.traverseTree(oRootNode);

}

</script>

<script language="javascript1.1"> load_data(); </script>

Comments

  1. 01 Jan 1999 at 00:00

    This thread is for discussions of Simple DOM Access.

Leave a comment

Sign in or Join us (it's free).

AddThis

Related podcasts

  • Episode 27: What Every Web Developer Needs To Know

    Kevin leads a discussion on what every web developer needs to know. Topics Javascript - language or toolkits? Does clean HTML matter? What are the tangible benefits? Working with designers who only speak Photoshop Basic usability Tools every web developer needs Progressive enhancement K. Scott i...

Related jobs