• 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 - System Events vs XMLlib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML - System Events vs XMLlib


  • Subject: Re: XML - System Events vs XMLlib
  • From: has <email@hidden>
  • Date: Fri, 31 Aug 2007 00:15:19 +0100

Ed Stockly wrote:

gary>>This is exactly the wrong way to approach XML and XML-like structured
documents.

Sure, this kind of scripting can get the data, but it's a lot of clutter for
no benefit. It's too specific to be a useful suggestion for any real scripting
of XML extraction.

In the world of Application scripting that kind of solution is often just
what's needed.

It's bad practice as it fails to account for the full complexities of XML - e.g. text encoding, character entities - and makes unsafe assumptions about the data being read - e.g. the value's type. While hacks [unfortunately] have their place, they should treated as a last, rather than first, resort, and when resorting to them it's wise to go in with a clear understanding of the potential risks and pitfalls that they present. As the Perl monks say, laziness is a virtue, and nothing's lazier than using a robust, mature library such as libxml2 to do all the work for you.



The other part of the discussion that Wayne has brought up, as did Has in an
earlier thread, is something that I think just about everyone can agree on"
There should be a collection of simple, easy to understand, working
AppleScript samples that make arriving at a solution like Has' as easy as it
should be.

Better official API documentation (including example code) would be my first want, and folks that feel the same shouldn't be shy about filing feature requests with Apple. Beyond that, there's plenty that individual members of the AS community can do to help out - e.g. MacScripter.net includes a Code Exchange section where anyone can post useful tested example code for others to benefit from and/or help to improve the examples already there. (BTW, I need to go do Ruby appscript stuff now, but please feel free to post my plist examples to it.)


Regards,

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________
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
  • Prev by Date: Re: XML - System Events vs XMLlib
  • Next by Date: Problem with a simple Excel 2004 script
  • Previous by thread: Re: XML - System Events vs XMLlib
  • Next by thread: Simple mail script not working
  • Index(es):
    • Date
    • Thread