Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML Data by Name instead of childNode Array?

From: Joe Kesselman <keshlam-nospam@-------.--->
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent