Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML file problem



Hi list,

I have an XML file with the following structure:

<?xml version="1.0" encoding="iso-8859-1" ?>
<myxml>
<child>
<data1><![CDATA[xxxx]]</data1>
<data2>yyyy</data2>
<data3>zzzz</data3>
</child>
</myxml>

Given that the XML file is generated online: can I just use the following line to store the complete contents of the XML file in a variable and somehow still access the "xxxx", "yyyy" and "zzzz" strings?
set theXML to do shell script "curl --silent 'http://myserver.com/generatexml.php" (output of the URL is an XML file)

If so, how can I store the 3 string values into an array (or 3 seperate values - it doesn't matter actually)?
If not, what's the best way to access these strings then?

I've tried via "System Events", but that didn't work:
set valueY to value of XML element "data2" of XML elements of XML element "child" of XML element "myxml" of XML element 1 of contents of theXML (gives a very strange "Can't make \"myxml\" into type integer" error)

Any help would be appreciated.

Regards,
Jasper.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.