Mailing Lists: Apple Mailing Lists

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

Re: parsing xml



Thanks all,

I gave the XMLlib a try but didn't get very far. I've got two questions about it.

1) Can I load the OSAX directly into my ASS project? I don't want to have to install the OSAX everywhere my project might run.

2) My xml files may not be true XML files. They are actually xxx.log files and use only the most basic tags such as 
<TagName> 
<subTag> some text</subTag>
 </TagName>


Chuck



On Jun 7, 2006, at 2:57 AM, Andreas Kiel wrote:

I can confirm Christopher's statement as well.

I tried the XML parsing which comes with the system, but wasn't to happy about - maybe I did something wrong. Then I started with the Satimage XMLlib OSAX and was immediately happy. It's very fast, reliable, memory save (which is very important for the work I do) and has a very good implementation of the XPath handling.  So you can use a path similar to "/book/chapter/@title" (or "//book[name='thespecialbook‘]/chapter[chapternumber <15]" if those values exist) to retrieve or modify a value or node
So if you want to use ASS and create XML or read and modify, I would recommend this OSAX.
But as Christopher Nebel also mentioned: AppleScript may not be the proper solution for you. Depending on what you want to do or how complex and big an XML is, it might take a serious amount of time to resolve. It's not the time to read and parse the XML to retrieve values from the XML, but the amount of time you may need with AS(S) to work with the values.

Regards
Andreas

On 07.06.2006, at 08:24, Philip Aker wrote:

On 2006-06-06, at 21:35:13, Christopher Nebel wrote:

Depending on what you're doing, AppleScript may not be the proper solution for you.  For simple transforms and extractions, I'm rather fond of XSLT these days.  (Some people think I'm mad, but there you are.)  Something that understands XPath (such as XSLT) will probably simplify your life dramatically.

I can confirm this observation. I'd also like to move that AppleScript file format be moved to XML ASAP. Something like .plist with a zip variant. Don't think I have to explain the advantages.

Cheers,

Philip Aker

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

This email sent to email@hidden

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

This email sent to email@hidden

 _______________________________________________
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

References: 
 >Re: parsing xml (From: Graham Jones <email@hidden>)
 >Re: parsing xml (From: Christopher Nebel <email@hidden>)
 >Re: parsing xml (From: Philip Aker <email@hidden>)
 >Re: parsing xml (From: Andreas Kiel <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.