Insert all xml nodes of type 1 into a variable with javascript

xadoa

New Member
I have the following:\[code\]root = xmlDoc.documentElement;for (i=0; i<root.childNodes.length; i++) { if (root.childNodes.nodeType==1){ // FILTERING NODE TYPEmyvar = root.childNodes.length;alert (myvar.length);}}\[/code\]The length returns 7 - which reflects ALL node types (unfiltered).What I want is: myvar should contain ONLY node elements of type 1How can I do that?Thanks,L.
 
Back
Top