• 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
satimage XML tutorial
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

satimage XML tutorial


  • Subject: satimage XML tutorial
  • From: Jean-Christophe Helary <email@hidden>
  • Date: Wed, 25 Mar 2015 00:01:06 +0900

I'm working through the XML tutorial offered by Satimage and I run into a problem, probably due to my lack of understanding of XPATH...

I'm using a TMX file that's structured this way:

tmx
	header
	body
		tu
			prop
			prop
			tuv
			tuv
		tu
			prop
			prop
			tuv
			tuv


etc.

I adapted the tutorial to the above structure:

set the_tmx to XMLOpen "/path/to/tmx"
set the_root to XMLRoot the_tmx
XMLCount the_root
set the_body to XMLChild the_root index 2
XMLNodeInfo the_body
set the_tu_1 to XMLChild the_body index 1
XMLNodeInfo the_tu_1
XMLGetText the_tu_1
set the source_tuv_1 to XMLChild the_tu_1 index 3
XMLNodeInfo source_tuv_1
XMLGetText source_tuv_1
set the target_tuv_1 to XMLChild the_tu_1 index 4
XMLNodeInfo the target_tuv_1
XMLGetText the target_tuv_1

And I get stuck here:
set {the_tuv} to XMLXPath the_body with "TU[PROP=\"TM\"]"

where Smile tells me: "Can't get item 1 of {}"

in my file, the first prop of the first tu is:

 <prop type="x-Origin">TM</prop>

Jean-Christophe Helary
 _______________________________________________
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


  • Prev by Date: contact list owner?
  • Next by Date: Re: contact list owner?
  • Previous by thread: Re: contact list owner?
  • Next by thread: Excel: Append to Range
  • Index(es):
    • Date
    • Thread