Lists Home |
Date Index |
Jeffrey Fitzgerald wrote:
> But what is the point of custom naming xml elements when they are
> not accessed in an OOP manner?
> Here is what I mean:
> <whatsUp>Whats the point</whatsUp>
> My understanding is that you don't access the contents using syntax
> like: newbie.question.whatsUp.value, but rather an obscure
> childNodes.childNodes.childNodes.nodeValue (not even sure if
> that is right).
You are just quoting an API, in this case the DOM, and unless you use a language
that equates NodeLists to arrays, you'll need to replace  with .item(0). In
fact, using the first item in the childNodes here is probably going to bite you
very hard since for newbie and question, the first node will be a text node
Using other APIs you could get what you want. Both Perl and Python have APIs
that will access the above as root.newbie.question.whatsUp, or something locally
You could also use XPath: /newbie/question/whatsUp.
Robin Berjon <firstname.lastname@example.org>
Research Scientist, Expway http://expway.com/
7FC0 6F5F D864 EFB8 08CE 8E74 58E6 D5DB 4889 2488