Library tutorials & articles
Simple DOM Access
By David Nishimoto, published on 27 Feb 2002
Page 2 of 5
- Introduction
- JavaScript functions
- Client Code
- Simple SDA Access
- Live Example
JavaScript functions
Below are the functions that will be made available by the sda javascript
function
addNode(sParent_Key,sKey,sElementName)
* Add a node into the xml structure
* Rule 1 - sKey must be unique
* Rule 2 - sParent_Key must exist
functiongetNode(sKey)
* Locates a node in the xml structure by its unique "k
ey" value
functiontraverseTree
* Print the contents of the xml structure (nodes and attributes)
functionnext
* Returns the "key" of the next node
* Rule 1 - Return the descendant node if one exists
* Rule 2 - If no descendant node exists return the next sibling
* Rule 3 - Otherwise return the parent node's - sibling node
functionprevious
* Returns the "key" of the previous node
* Rule 1 - Find Sibling - Find the bottom-most child of the sibling
* Rule 2 - Return previous sibling
* Rule 3 - Return parent node child node.
functionsetAttribute(sKey,sAttribute_Name,sValue)
* Associate an attribute name/value to a "node" element
functionremoveAttribute(sKey,sAttribute_Name)
* Remove an attribute name from a "node" element
functiondeleteNode(sKey)
* Remove a "node" element matching a filtered "key" value
functiongetCurrentNodeKey()
* Return the current "key" value for the active node
* Used with next and previous methods
functionsetCurrentNodeKey
* Set the current key value
* Used with next and previous methods
Related articles
Related discussion
-
vb6 generated help file not working in Window 7 and Vista
by Thushan Fernando (1 replies)
-
(Very urgent)how to assign the value of the variable in javascript function into php variable
by mazhar_qayyum (3 replies)
-
Postback data problem
by royal ludhiana (1 replies)
-
Problem Regarding .NET coding (Using Java Script,Ajax) Plz Plz Help me.
by boulou (0 replies)
-
Treeview with Ajax and xml
by lgmperera (0 replies)
Related podcasts
-
Ajax, DWR, and Spring
Improving the User Experience without the JavaScript hassle: Ajax, DWR, and Spring Buzzwords like AJAX (Asynchronous JavaScript And XML) and XmlHttpRequest are buzzing around Java blogs for months now. The DWR (Direct Web Remoting) project aims to provide easy AJAX for Java. This session will...
Events coming up
-
Nov
20
Full Frontal JavaScript Conference
Brighton, United Kingdom
A one day JavaScript conference held in Brighton, UK whose essence is to discuss JavaScript "with nothing concealed or held back".The conference is being held at one of the world's first cinemas, which first opened in 1910.Speakers include...
This thread is for discussions of Simple DOM Access.