I'm writing an AppleScript action for iTunes that needs to query some information from an XML file, which isn't available natively :(. Currently I'm using 'xmllib' from http://www.satimage.fr/software/en/downloads/downloads_companion_osaxen.html
to run xpath queries in applescript. But I wan't to write this script without any 3rd-party dependencies, if at all possible and for this part of the process that I'm automating, XMLLib is the only 3rd party dependency.
So, now I was wondering if I could use any of the built-in (pre-compiled) tools that will run from commandline to query an xml-file using xpath. Considdering an xpath that returns a string, '//Series/id/text()'
, this would be quite acceptable to me and would negate the need for installing the above-mentioned scripting plugin. For instance I was wondering if Perl or PHP could be abused to do this for me, I've seen similar tricks somewhen/where but I have hardly any experience with PHP and 0 with Perl, nor is Bash-scripting among my strengths :)
Requirements would be for this commandline tool to be available on OSX.4 running on a PowerPC, since my media-server is an old G4 that doesn't run any later version :)
FYI, the AppleScript action, when 'finished', will be opensourced.