|
XML
Tools 2.9
Download Version 2.9
(424KB) - Mac OS X Universal (PowerPC - 10.3.9 or later, Intel - 10.4
or later)
Download Version 2.8 (652KB)
- Classic Mac OS (9.2), Mac OS X PowerPC (10.0 or later)
The XML Tools AppleScript Scripting Addition allows AppleScript to parse
and generate XML data. XML Tools's
parsing can generate a complete DOM-like structure or it can operate
in a SAX-like event handling mode.
If you value the ongoing development of XML Tools,
consider making a modest donation of US$10 to assist us in making them
possible.

Credits/Legal
The XML Tools OSAX uses James Clark's Expat XML parser. The Expat license
and distribution is available here.
THIS SOFTWARE IS PROVIDED AS-IS,
WITHOUT WARRANTY OF ANY KIND. THE AUTHOR DISCLAIMS ANY DAMAGES RESULTING
FROM THE USE OR MISUSE OF THIS SOFTWARE.
THIS SOFTWARE IS COPYRIGHT © 1998-2004 LATE NIGHT SOFTWARE LTD.
& MARK ALLDRITT. YOU MAY USE AND/OR DISTRIBUTE THE SOFTWARE WITHOUT
RESTRICTION. IF YOU BUNDLE THE SOFTWARE WITH ANY COMMERCIAL OFFERING,
YOU MUST DISPLAY THIS COPYRIGHT NOTICE IN THE SOFTWARE'S DOCUMENTATION
AND/OR ABOUT BOX. YOU MUST ALSO COMPLY WITH ANY DISTRIBUTION RESTRICTIONS
SET OUT IN THE EXPAT LICENSE THAT MAY APPLY TO YOU.
Installation
| Mac OS X Installation |
Classic Mac OS Installation |
Download
the Universal version of XML Tools and follow these steps to install
the XML Tools scripting addition on Mac OS X systems:
- Create a folder named ScriptingAdditions in your account's
Library folder
if one does not already exist.
- Copy the XML Tools.osax file into your account's ~/Library/ScriptingAdditions folder.
|
Download the Classic
Mac OS version of XML Tools (2.8).
Install XML Tools on
Mac OS 9 systems by simply copying the XML Tools scripting
addition file to the Scripting Additions folder of your Macintosh.
The Scripting Additions folder is located within your System Folder.
NOTE: Do not use the XML Tools.osax
file! This file is intended for Mac OS X systems. |
Documentation
XML Parsing (DOM-like
parsing) reference
XML Event Based Parsing (SAX-like parsing)
examples
XML Generation reference
AppleScript XML Processing Utilities
Encodings reference
Sample Applications
Watch News is a sample AppleScript &
FaceSpan application that uses XML Tools to read Userland Software's syndication
files.
XML-RPC is a sample AppleScript application
that uses XML Tools in combination with the Mac OS's URLAccess Scripting
feature to invoke a remote method via the XML-RPC
protocol.
Change History/Release Notes
2.9 June 7, 2006
- Native Intel Macintosh support (distributed as a Universal binary).
- Added simple dom option to the parse
XML command. The simple dom parameter causes parse XML to return
an alternate record structure that allows you to navigate directly to
elements without having to iterate and search.
- You can now pass aliases and file references to the parse
XML command's base path parameter.
2.8 April 15, 2005
- Fixed a bug when generating XML containing namespace references.
- Fixed a bug when parsing MacRoman XML files where the Apple and
Euro symbols are not properly handled.
- Fixed a bug where newline characters are not properly reported to
SAX handlers
2.7 May 17, 2004
- Restored support for parsing XML files containg MacRoman high-bit
characters. Please refer to the new Encoding page
for further details. Note, to parse MacRoman XML files you must now
specify the MacRoman encoding.
- Added a new page to the web site explaining
how XML Tools supports XML encodings.
- Added a new encoding parameter to the parse
XML command which allows
you to override the encoding specified in a file's XML Declaration.
- Fixed a bug where generating XML files with HFS file paths containing
long (>31 characters) file names would truncate the file name.
To specify an HFS
path with a lone file
name you must say: file "volume:folder:long-file-name.xml".
Use
of
AppleScript's file specification (FSSpec) class will
result in truncated file names. POSIX file path specifications are
not effected by this bug.
2.6 April 22, 2004
- Revised on-line documentation
- Added XMLToolsLib AppleScript utility/sample code
- The parse XML command can now read XML from files. This means that
you no longer have to read the XML data that you want to parse yourself.
XML
Tools handles MacRoman, UTF-8 and UTF-16 text files.
- The generate XML command can now write the generated XML directly
to files using the new saving as parameter. The generating
unicode parameter has been renamed generating UTF16, and
a new generating UTF8 parameter has been added. The generating
UTF16 and
the new generating UTF8 parameter control the type
of file created.
- A newer version of the expat XML parser is being used to resolve
crashing bugs in the older expat code.
- The parse XML command now returns an XML contents property for empty
tags (<tag/>) and a new including empty elements parameter has been
added to rever to pre v2.6 behavior.
- The parse XML command provides for SAX-like event-based processing
of XML data. More information on event-based XML processing is available here.
2.5 Sepember 29, 2002
- Added a new separate namespace URIs parameter to the parse
XML command. This parameter, which is true by default, controls how
namespaces are reported when parsing XML data. When true, XML Tools
reports tag names and the associated namespace in separate properties
of the XML Element record, XML tag and XML namespace uri respectively.
When false, only the XML Tag property is generated containing both
namespace URI and the tag name in the format UTL:TagName.
- Mac OS X 10.2 introduced changes to the AppleEvent Manager that
slowed XML Tools down considerably when parsing complex XML documents.
XML Tools 2.5 contains changes that improve performance by roughly
20% on 10.2 systems.
2.4 March 14, 2002
- Added a new allowing leading whitespace parameter to the parse
XML command. This parameter, which is false by default, causes XML
Tools to ignore any leading white space in an XML data stream.
NOTE: XML Tools 2.3.2 introduced a change where leading white
space was always ignored. This raised the eyre of XML purists so
we've made this an optional behavior for XML Tools 2.4.
- The XML leading comments property of the XML Document class
has been renamed XML Prolog and now includes both comments and
processing instructions appearing before the root tag in an XML document.
- The generate XML command now properly encodes entities for markup
characters (&, <, >) appearing in tag attribute values.
- Processing instructions containing colons (e.g. <?xml:stylesheet
... >) are now parsed correctly.
- The generate XML command can now handle the case where processing
instructions appear in the XML prolog (i.e. before the root tag).
2.3.2 November 20, 2001
- Whitespace can now appear before the initial <?xml ... ?> element.
- The generate XML command corretly emits whitespace between attributes
when pretty printing is disabled.
2.3.1 October 5, 2001
- Corrected problems introduced by the 2.3 release that rendered the
generate XML command inoperable.
2.3 August 24, 2001
- XML Tools now supports all aspects of the Native PowerPC Scripting
Addition API as defined by Apple. Previous versions did not support
reference counting.
- Added XML element id to the XML Element class to indicate
element serialization. This replaces the old way of doing this via
an ID attribute that proved difficult to use from AppleScript.
- XML Tools now properly reports mismatched tag errors. Previous versions
reported a very unhelpful paramErr (-50) in this case. This version
will indicate a mismatched tag error and suggest an offending line
and character offset, as it does with other XML parsing errors.
- Some memory management errors have been resolved that should address
instability problems.
- The generate XML command now properly handles 'without pretty printing',
and white space is no longer introduced into the resulting XML stream.
2.2 March 24, 2001
- Native support for Mac OS X.
2.1 August 13, 2000
- The parse XML command now supports the xml-space="preserve" tag
attribute that causes white space to be retained within the data associated
with the tag.
- The parse XML command now has a boolean preserving whitespace parameter
that allows you to direct parse XML to preserve white space characters
(space, tab, newline) within XML data.
- The generate XML command now has boolean pretty printing parameter
controlling the formatting applied to generated XML data.
- Added the Save & Restore Desktop sample scripts.
2.0 April 13, 2000
- XML Tools now uses the October 12, 1999 Test version of the Expat
XML parser (the build system has been changed to allow drop-in
integration of future Expat releases).
- The parse XML command can now return XML namespace information.
- The parse XML command can now return XML processing instruction information.
- The parse XML command can now return XML comment information.
- The parse XML command can now process external entity (DTD) references.
- The parse XML command can now serialize each parsed XML Element.
- The parse XML command now returns the XML Document class that contains
document level information. All parsed elements continue to be returned
as XML Element classes.
- A new generate XML command has been added to provide high speed XML
Element/XML Document to XML text conversions.
- XML Tools now uses the native PowerPC OSAX interface supported by
Mac OS 8.6 and later.
XML Tools version 2.0 Limitations:
- The generate XML command does not generate CDATA elements.
- External entity SYSTEM IDs must be valid URLs of the form file://...,
http://... or ftp://...
|