>If all your interested in are the child elements (i.e. CreateUser) use
>getElementsByTagName as appse to getChildNodes which returns Attribute and
>Text nodes

Sorry, this is not quite right.

getChildNodes will _not_ include attributes. In the DOM model, Attr nodes
are side-information, not children. It will, however, include text,
comments, etc. which are immediate children of the node you're starting
from.

Note that getElementsByTagName searches the entire subtree. That means it
may find any maching descendent element, not just immediate children of the
node you're starting from. Depending on the structure of your document,
this may not make a difference in the results -- but it's a more expensive
search operation than examining the immediate children.

Personally, I generally recommend avoiding either operation for serious
application development, since NodeLists have some programming and
performance hazards as documented in the DOM FAQ. It's not hard to either
navigate the document tree explicitly or use the DOM Level 2 "traversal"
mechanisms.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to