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

Re: XML to AppleScript Record


  • Subject: Re: XML to AppleScript Record
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 3 Mar 2008 12:07:54 -0800

On Mar 3, 2008, at 11:24 AM, Stockly, Ed wrote:

Before I go about reinventing the wheel, I have a question for the list.

Has anyone tried converting XML data to an appleScript record, using the xml
tags as record labels.


In other words,

<root>
 <xmlDataFormat Version="1.1">
 <dataTagFoo>
   <dataTagBar>
    "Data"
   </dataTagBar>
  <dataTagMore>
    "More Data Data"
   </dataTagMore>
</dataTagFoo>
</root>

Should translate as:

{root:{{xmlDataFormat:{version:"1.1:"}}, {dataTagFoo: {dataTagBar:"Data"}},
{dataTagMore:"More Data Data"}}}


I couldn't see how to do this with any of the XML osax or system events. Am
I missing something?

Aside from the fact that such a transformation isn't possible on a lot of XML? Anything where the tags aren't unique, to be precise? Not to mention the whole records-aren't-really-associative-arrays-stop-trying- to-use-them-like-they-are argument. System Events and the various XML osaxen will let you manipulate the XML, is there a reason you specifically wanted a record?



--Chris Nebel AppleScript Engineering

_______________________________________________
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: XML to AppleScript Record
      • From: "Stockly, Ed" <email@hidden>
References: 
 >XML to AppleScript Record (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: Modification date in leopard
  • Next by Date: Re: XML to AppleScript Record
  • Previous by thread: XML to AppleScript Record
  • Next by thread: Re: XML to AppleScript Record
  • Index(es):
    • Date
    • Thread