«»

Technicality

· 11TH OF SEPTEMBER, THE YEAR 2006

OPEN SOURCE XML DEVELOPMENT ON MAC OS X

I’m taking an intro class in XML and, being a Mac user, I’d like to be able to do my work on a Mac. Also, being an open source person / cheapskate, I’d prefer that my software be open source, or at least freeware. There doesn’t seem to be any single package out there that meets these requirements and does the kind of things that commercial packages like XMLSpy or oXygen do, but a lot of their functionality can be replicated piecemeal.


Editing

Your favorite text editor.

Validation

XML Nanny – supports DTD, XML Schema, RELAX NG, and Schematron

Query & Transformation

XSLPalette – haven’t played with it yet, but claims to support XSLT 2.0, XPath 2.0, and XQuery 1.0 debuggery.

Addendum

It does, but it’s certainly not a replacement for XMLSpy’s XPath functionality. For that I turned to the 4suite XML package for Python. Using it within an interpretive shell (IPython, in my case) worked alright:

from Ft.Xml.Domlette import NonvalidatingReader as NVR
doc = NVR.parseUri('file:document.xml')
doc.xpath('//someElement')

Aside from serious performance issues on large documents it seemed to work ok. NOTE: if your XML document has a namespace set, the xpath() method will return nothing if you query for elements in the document without first decalring the XPath namespace. It won’t give you any friendly error messages explaining what’s going wrong. Check out the docs.

Generating a Schema from an Instance

Because sloth is a virtue in development. A couple solutions discussed in XML Hacks (sorry, not free), but the one that worked the quickes for me was…

DTDGenerator – creates a DTD from an XML document instance.
Usage:
java DTDGenerator inputfile > outputfile

Others: Trang (RELAX NG, DTD, XML Schema), Relaxer (RELAX NG, DTD, XML Schema)

NO COMMENTS YET

Comments are closed.