|
XMLLib osax Publisher's Description:
XMLLib osax is a Scripting Addition which implements the XML DOM in AppleScript. Features include:
* opening, validating, closing, saving an XML document
* browsing an XML tree - parents, children, siblings
* searching an XML tree - sending a XPATH request
* editing, creating, removing an XML node
* searching text in an XML node
* applying a XSLT stylesheet
* handling XLinks
XMLLib carries references rather than data or object specifiers, so a script can process large XML documents as fast as if you had been writing a C program - yet, in a more comfortable environment.
Also includes a similar set of commands for Property lists (p-lists). Transparently store AppleScript objects in p-lists. Provide a fast lookup table (or "dictionary", or "associative array") structure.
What's new in this version:
* XMLLib.osax now uses libxml-2.6.31 and libxslt-1.1.22.
* XMLLib.osax now uses libxml-2.6.29 and libxslt-1.1.21. exslt functions in xsl stylesheets are now supported by the XMLTransform command. Note that XML errors handling does not support any more files or texts containing carriage return (CR) as line separator (line number and selection of an error may be irrelevant in such cases).
* The XMLXpath command conforms to XPath1.0 and adds the XPath2.0 functions compare, upper-case, lower-case, ends-with and base-uri in the namespace "http://www.w3.org/2005/xpath-functions". XMLXpath also adds the function applescript in the namespace "http://www.satimage-software.com/xpath-functions". The first argument of applescript is the name of the AppleScript handler, the following arguments are passed to the handler.
* XML and Plist commands now support opening URLs (like XMLOpen "file://localhost/folder/name.xml", XMLOpen "http://domain.com/folder/name.xml" or XMLOpen "ftp://login:pasword@domain.com/folder/name.xml".)
* The XMLSave command has now two more optional parameters: xml declaration (to omit xml declaration when saving), and encoding.
* The XMLOpen and XMLSave commands now have a html4 flag to handle HTML instead of XML.
*
The XMLOpen command has a new from string parameter. You must provide to XMLOpen a file reference or an url as direct parameter, or an xml string with the from string parameter (e.g. XMLOpen from string "".)
Commands that supported file references as parameter (e.g. XMLOpen) did supported hfs paths at the same time: you could run XMLOpen "disk:path:file.ext" instead of XMLOpen ("disk:path:file.ext" as alias). This is not allowed any more, to permit such texts to be urls or unix paths. Note that you can still provide an xml string as the direct parameter of XMLOpen for backward compatibility.
* XMLLib commands that accept a list of XMLRef as parameter can now accept an XPathRef instead. An XPathRef is a record defining a list of XMLRef by providing a node and an xpath string. Cf XMLLib.osax's dictionary for more info.
* The new XMLNewIndex and XMLLookup commands can be used to optimize XPath requests by evaluating once and for all an xpath request and putting the results in an index.
* XMLLib.osax commands should not crash any more when you use obsolete XMLRef that has been suppressed with XMLRemove or other XMLLib commands.
* The XMLValidate command has a new against parameter to validate an XML document against a given DTD (provide an alias or an URL).
* The new XMLSetExtras and XMLGetExtras commands associate some AppleScript content with a xml document. Those commands have no effect on the XML part of the document. Those commands are analog to the volatile extras property of Smile's scriptable objects.
* The XMLDocument and PlistDocument commands now return a list if relevant.
* XMLLib.osax now supports more encodings, such as "macintosh" (not recommended).
* The XMLDisplayXML command has a new xml declaration parameter (true by default) to display the xml declaration "
* The XMLDisplayXML command now display the namespaces of the elements, even if those elements were defined in an upper level of the XML. For example:
set x to XMLOpen from string ""
set b to XMLChild (XMLRoot x) index 1
XMLDisplayXML b
--"" (and not "")
|