Re: XMLNextSibling is there an easier way
Re: XMLNextSibling is there an easier way
- Subject: Re: XMLNextSibling is there an easier way
- From: Jim Skibbie <email@hidden>
- Date: Thu, 01 May 2008 11:21:02 -0500
- Thread-topic: XMLNextSibling is there an easier way
Title: Re: XMLNextSibling is there an easier way
Thanks for the advise. I wasn’t aware of the bypassing namespace option. It makes it a lot cleaner.
Jim
Yes, the resulting obfuscation is a high price to pay the absolute universality that namespaces allow.
Tong in cheek, they made XML, then they said "would be too simple, everyone will be able to use it, is that what we want?", so they made namespaces.
That's why XMLLib enables a "bypassing namespaces" option for XMLOpen, which should allow you to get rid of the "fred" stuff. Maybe you could give this option a try.
Finally, back to your post's original subject, you can get rid of the nextsibling if you say "search the ROW which contains an IDNoSetItemParent equal to 6353368, and return its VALUE child". Which gives:
set the_root to XMLRoot (XMLOpen theFile with bypassing namespace)
XMLXPath the_root with "ROW[IDNoSetItemParent='6353368']/Value"
or, if you just want the textual value of the node:
XMLXPath the_root with "string(ROW[IDNoSetItemParent='6353368']/Value)"
-- "VARnumber"
(and, you see, single quotes make a more legible XPath.)
Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden