Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XML Data by Name instead of childNode Array? >Thread Next - Re: XML Data by Name instead of childNode Array? Re: XML Data by Name instead of childNode Array?To: NULL Date: 11/4/2006 12:57:00 AM richard.morey@g... wrote: > but I would like to be able to get the value for each field without > having to iterate through each child. Depending on the environment you're working in, you may be able to use the DOM Level 2 traversal mechanisms, or the DOM Level 3 XPath support, which can do that iteration for you... but those are optional features, so it conflicts with your goal of being cross-browser compliant. Writing your own loop to scan the kids really is the simplest solution. > "text" property is only available on IE. When I try using "nodeValue" > it is always null. In the basic DOM, Element nodes have no value; you have to walk the tree and gather the value of the contained text nodes. Again, some of the optional features of later DOMs can help, but that conflicts with your goal of interoperability. Find a good DOM tutorial, and write a few convenience subroutines. -- () ASCII Ribbon Campaign | Joe Kesselman /\ Stamp out HTML e-mail! | System architexture and kinetic poetry | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
