• 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: Lists to XML ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lists to XML ?


  • Subject: Re: Lists to XML ?
  • From: Jean-Christophe Helary <email@hidden>
  • Date: Sat, 25 Mar 2017 20:39:56 +0900

2) What Steve Mills mentioned about "using setAttributesAsDictionary" to set the <header> attributes

I think he meant setAttributesWithDictionary:. So:

(tmxHeader's setAttributesWithDictionary:{adminlang:"en", datatype:"unknown", segType:"paragraph", ... })

Regarding the use of a dictionary, I found that "o-tmf" was not accepted in that list because of the "-", so I had to add it separately with the original attributeWithName method I had, like this:

(tmxHeader's setAttributesWithDictionary:{creationtool:"xls2tmx", creationtoolversion:"0.1", srclang:myTMsrclang, adminlang:"en", datatype:"unknown", segtype:"paragraph", creationdate:myDateString})
set headerOtmf to (current application's NSXMLNode's attributeWithName:"o-tmf" stringValue:"Microsoft Excel")
(tmxHeader's addAttribute:headerOtmf)

I get the same result, except that o-tmf is last in the attribute list, but that's ok because attribute order is irrelevant in XML. But still, I don't find that very elegant... Too bad dictionaries are that picky regarding the syntax of their elements.

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

  • Follow-Ups:
    • Re: Lists to XML ?
      • From: Shane Stanley <email@hidden>
References: 
 >Lists to XML ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: Lists to XML ? (From: Shane Stanley <email@hidden>)
 >Re: Lists to XML ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: Lists to XML ? (From: Steve Mills <email@hidden>)
 >Re: Lists to XML ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: Lists to XML ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: Lists to XML ? (From: Shane Stanley <email@hidden>)
 >Re: Lists to XML ? (From: Jean-Christophe Helary <email@hidden>)
 >Re: Lists to XML ? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Lists to XML ?
  • Next by Date: Re: Lists to XML ?
  • Previous by thread: Re: Lists to XML ?
  • Next by thread: Re: Lists to XML ?
  • Index(es):
    • Date
    • Thread