• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: parsing an XML file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >parsing an XML file (From: email@hidden)

  • Prev by Date: Re: New Tiger dictionary format example posted
  • Next by Date: Re: Help with droplet
  • Previous by thread: Re: parsing an XML file
  • Next by thread: What is the best way to get the name (without the extension) of a file?
  • Index(es):
    • Date
    • Thread