Running XSL • 1 February 2012 • The SnowBlog

Running XSL

          
Well, fancy that. I've found a new command-line way to transform massive XML files. No more java heap space exceptions! No more paying a mahoosive license fee for Oxygen XML just to transform XML! This is for Mac only. Open the Terminal application. Change into the directory which contains both your XML and XSL files by entering the file path: cd path/to/your/folder You can use XSL to transform any sort of XML file. For instance, you might want to convert an ONIX file from its short-tag version to the long reference tag version. Run: xsltproc shorttolong.xsl short.XML -o long.xml That syntax is: call the command 'xsltproc'. (The libraries are built in to OSX, so you don't need to have installed anything to get this to work.) Give the name of the XSL file you want to use. Then give the name of the XML file you want to transform. Write -o, and then give the name you want the output file to have. Simples and usefuls!

Emma

The SnowBlog is one of the oldest publishing blogs, started in 2003, and it's been through various content management systems over the years. A 2005 techno-blunder meant we lost the early years, but the archives you're reading now go all the way back to 2005.

Many of the older posts in our blog archive suffer from link rot. Apologies if you see missing links and images: let us know if you'd like us to find any in particular.


Read more from the SnowBlog...

« Ruckus in the world of academic journals
Amazon recommendations visualised »