Cocoatron.. just a little tender, loving pimpage…
![]()
Over Thanksgiving holiday, I released version 1.0 of Cocoatron… a collection of Automator actions for graphically creating XML Processing Pipelines on Mac OS X. Cocoatron was inspired by XProc, the W3C’s emerging standard for XML processing pipelines described in XML itself, and Norm Walsh’s open source SXPipe — a similar open source project written in Java.
Cocoatron was instantly met with — shall we say — polite silence.
It’s a shame, cuz of all my personal software projects, I thought Cocoatron was one of the more interesting ideas… yet it’s probably gotten the least response.
[FYI… Cocoatron is not to be confused with an even younger Cocoa-related project that has an alarmingly similar name… ]
According to my site traffic logs, I seem to have acquired some new readers since releasing some TextMate Plug-Ins. So I thought I’d take this opportunity to pimp Cocoatron anew… here goes…
Cocoatron is a suite of six Automator Actions (pipeline stages) which you can include (or not) in your pipeline (Automator Workflow) in any number of ways:
- Load XML Documents
- Process XIncludes of XML Documents
- Validate XML Documents (DTD, XSD, RNG)
- Transform XML Documents (XSLT)
- Query XML Documents (XQuery)
- Serialize XML Documents
And one custom Automator data type which is used to pass XML documents between Cocoatron Actions: XMLInfoset.
Cocoatron is a simple way to create XML pipelines without writing a line of custom ‘glue’ code in Java, Python or any other language.
Cocoatron could also be used for automating the validation of local or remote XHTML web documents on Mac OS X.
Much like SXPipe, these actions deal strictly with XML Infosets. Under the hood, the XML Infosets created and returned by Cocoatron Actions are actually libxml2 xmlDocPtr structs contained in Cocoa object wrappers. An Infoset is constructed using Load XML Documents and serialized back to text using Serialize XML Documents. To create pipleines, place other, built-in Apple Actions before and after these two Actions.
For example, start an XML pipeline with local XML documents using Get Specified Finder Items (Finder) or remote documents using Get Specified URLs (Safari). Finish a pipleine with New Text File (Finder) or New TextEdit Document (TextEdit).
Each Cocoatron Action includes a collapsable Console text field that will show you any errors or warnings that occur during that Aciton’s processing. This allows for easy debugging.
Implemented using libxml2, libxslt, libexslt, and NSXML, Cocoatron suppors XSLT 1.0, XQuery, XInclude, and validation against DTD, W3C XML Schema, RELAX NG.

About this entry
You’re currently reading “Cocoatron.. just a little tender, loving pimpage…,” an entry on Todd Ditchendorf’s Blog.
- Published:
- 01.17.07 / 11pm
- Category:
- AppleScript, Cocoa, Mac OS X, NSXML, Objective-C, RELAX NG, Web Development, XML, XML Schema, XPath, XQuery, XSLT, libxml2
No comments
Jump to comment form | comments rss [?] | trackback uri [?]