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>

You might also like...

Comments

About the author

David Nishimoto United States

NishiSoft provides Part I of the Information Technology Project collaboration. Sign up and list your IT project tasks, assign task too friends, and get percent complete task.

Part will ...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programs must be written for people to read, and only incidentally for machines to execute.”