Re: XML question
Re: XML question
- Subject: Re: XML question
- From: "Christian Roth" <email@hidden>
- Date: Tue, 5 Dec 2006 13:54:08 +0100
Ruth Bygrave wrote:
>Trying to get the 'book name' attribute from the book element (the
>only thing in the XML file), I have tried:
>XMLGetText ((XMLXPath with "book name@book"))
>XMLGetText ((XMLXPath with "book@book name"))
>and various other perms & combs of the above, and the syntax seems to
>be choking the parser however I try.
that's actually an XPath problem. To access the name attribute on the
book element in something like:
<book name="The Name of the book">...</book>
, you do that in XPath with
book/@name
that is "when on the book element, give me the 'name' item on the
attribute axis".
Note that an element can not have an attribute named "book name" because
that is not a NMTOKEN, i.e. not a valid name for an attribute. Attribute
names must not contain spaces.
The specification details can be found here:
<http://www.w3.org/TR/xpath>
HTH,
Christian
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden
References: | |
| >XML question (From: Ruth Bygrave <email@hidden>) |