Re: Problem parsing XML from a SOAP call
Re: Problem parsing XML from a SOAP call
- Subject: Re: Problem parsing XML from a SOAP call
- From: garbanzito <email@hidden>
- Date: Thu, 21 Feb 2002 00:28:05 -0700
at 2002 02 20, 15:37 -0500, they whom i call Tim Jarrett wrote:
Folks:
I'm having some interesting times parsing the XML from a SOAP call.
I'm using the SOAP API for the Manila content management engine. For
the most part the output is pretty straightforward, and I can go in
and grab the pieces I'm looking for by name. However, I'm having
problems with getting access to items in this XML structure
(appended at the end of the message).
AppleScript turns the XML into a list with named items, with each
item having the format
departmentname:{createdDate:timestamp, pictureshortcut:"picturename"}
just taking a crack at this, because i want to learn more
about using XML with AppleScript. what you are seeing
are records, which in AppleScript must be handled very
differently from lists.
in short, records are unordered sets of "properties", which
are represented as name/value pairs joined by a colon.
because they are unordered, there is no "item 1",
and because the names are not considered strings, you are
going to have an unpleasant time getting the value of
a property if you don't know the name already.
just to make things complicated, the records you are
getting also have records as values for each of the top-level
properties.
so if you know the names pictureshortcut and america when you
write your script, you can do something like:
get pictureshortcut of america of {america:{pictureshortcut:"topicAmerica"}}
but if you don't know the names of properties in advance, you'll
have to refer to the archives on some awkward workarounds
(with which i'm not intimately familiar).
it does seem that you are getting data which could be better
structured. is this the kind of thing SOAP always returns? is it
a symptom of how AppleScript handles XML? or is it just how Manilla
is set up? i think it would be easier to work with if anything
not predetermined were a value within each record, such as:
{department:"america", pictureshortcut:"topicAmerica"}
--
steve harley email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.