Re: parsing an XML file
Re: parsing an XML file
- Subject: Re: parsing an XML file
- From: Le Stang Jean-Baptiste <email@hidden>
- Date: Wed, 4 May 2005 07:40:09 +0200
FIrst thing : ther is a space in "Slides " :p
set the_root to XMLRoot the_doc set {my_track} to XMLXPath the_root with "/Project/Movie/Track/Track_Name[text()='\"Slides\"']"
The correct XPath _expression_ is this one : "/Project/Movie/Track/Track_Name[text()='\"Slides\"']", text() allow you to get the textual content of a node. You might also consider removing all the quotes of your XML file, I think that this will produce more errors than anything else.
++ Jean-Baptiste
With AppleScript and XMLLib, I can't seem to programmatically traverse the XML tree. This code: set the_file to choose file set the_doc to XMLOpen the_file set the_root to XMLRoot the_doc set {my_track} to XMLXPath the_root with "Movie/Track[Track_Name=\"Slides\"]" XMLDisplayXML my_track gives a "Can't get item 1 of {}" error, yet I can get to the right track with: |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden