[svg-developers] Re: parseXML and accessing nodes.

2005-04-07 Thread jophof007
Hi, A line break (return) in your xml gives a extra node. This is called white space nodes you have to skip these nodes. John --- In svg-developers@yahoogroups.com, Rerun <[EMAIL PROTECTED]> wrote: > I added a while loop that throws me for a loop, no pun intended. > > > > > >

[svg-developers] Re: parseXML and accessing nodes.

2005-04-07 Thread ctl271
--- In svg-developers@yahoogroups.com, Sean <[EMAIL PROTECTED]> wrote: > So getElementById is of no help. Below is what I have, but it doesn't > behave how I think it should. I've stared the lines of code that are > throwing me off. Also, how do I get "alert(child);" to show the > contents

Re: [svg-developers] Re: parseXML and accessing nodes.

2005-04-07 Thread Sean
Perfect, all I had to do is eliminate all of the line breaks and no type 3 nodes. Thanks. jophof007 wrote: >Hi, > >A line break (return) in your xml gives a extra node. This is called >white space nodes you have to skip these nodes. > >John >--- In svg-developers@yahoogroups.com, Rerun <[EMAIL

Re: [svg-developers] Re: parseXML and accessing nodes.

2005-04-08 Thread Sean
There is still one thing nagging me about parseXML. Below is a while loop that should work, at least as far as I know, but doesn't. The alerts display the contents of the node, thank you ctl271. If I comment out "myGeometryToAdd.appendChild(child);", all of the child nodes in the loop and a

Re: [svg-developers] Re: parseXML and accessing nodes.

2005-04-08 Thread Sean
For anyone interested, below is my workaround, although I'd still like to know why my first attempt failed. Thanks.. var child = node.firstChild.firstChild; var theID=""; var nodeArray = new Array(); var i = 0; var myGeometryToAdd = ''; while (child != null) { if(child.nodeType==1){ nod

Re: [svg-developers] Re: parseXML and accessing nodes.

2005-04-08 Thread Larry Mason
appendChild is changing the owner of the child node and making it the last child of the parent. Therefore it will have no siblings after it. You could clone the node and append the clone (if a copy is desired) or compute the sibling BEFORE performing the append [which is what your workaroun

Re: [svg-developers] Re: parseXML and accessing nodes.

2005-04-08 Thread Sean
I'd be interested in seeing a cleaner approach. Thanks. Larry Mason wrote: >appendChild is changing the owner of the child node and making it the >last child of the parent. Therefore it will have no siblings after it. > You could clone the node and append the clone (if a copy is desired) >