Re: XML to AppleScript Record
Re: XML to AppleScript Record
- Subject: Re: XML to AppleScript Record
- From: "Stockly, Ed" <email@hidden>
- Date: Mon, 03 Mar 2008 12:35:48 -0800
- Thread-topic: XML to AppleScript Record
>> 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?
I hadn't really thought of that. In the data I'm working with there would
never by duplicate tags in the same xlm element. (TV Listings by date, time,
channel, title).
>>Chris>Not to mention the whole
records-aren't-really-associative-arrays-stop-trying- to-use-them-like-they-are
argument.
>>Mark>>A general solution for such a thing would take us right back to the
"records vs associative arrays" argument.
I know, I know, I'm being contary, but if you think of records as a nifty
hammer then xml data looks pretty much like a nail. It's as if they were
made for each other.
>>>It doesn't make sense to do things that way unless you know ahead of time
what the XML will look like.
In this case I do know exactly what the XML tag structure will look like and
a good bit of the data.
>>>System Events and the various XML osaxen will let you manipulate the XML, is
there a reason you specifically wanted a record?
Yes, I have a script I've been using for years (before OS X or any of the
xml osax were available) that reads a specific XML file and parses the
contents into records that I use for various purposes.
Since the rest of the work flow is built around records, I'm looking for a
more efficient way to generate records from xml.
Also, I find records much easier to work with, easier to find data,
manipulate contents and extract text, than the output from the XML osax I've
tried. They seem to add an extraneous layer that just gets in the way and
makes things more complex.
FYI, I'm still using my pure AppleScript xml parser rather than the osax or
system events.
ES
_______________________________________________
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