blog.humaneguitarist.org

XSLT transformations: "more than meets the eye"

[Sun, 09 Aug 2009 23:38:15 +0000]
A few months ago, my department head had encouraged us to learn about XML stylesheets and XSLT transformations [http://en.wikipedia.org/wiki/XSL_Transformations]. After picking at it here and there, I finally had my breakthrough with it this weekend. Of course, were I more patient, I could have gotten paid to do this at work tomorrow. As usual, the majority of the work is in finding examples and explanations that speak to me. This thread [http://www.biglist.com/lists/xsl-list/archives/200208/msg00525.html] was particularly helpful. One of the biggest breakthroughs - as embarrassing as it is to admit - was my realization that one needed an XSLT processor to actually create a new XML document based on the instructions provided in the stylesheet. I've been experimenting with both the Saxon [http://saxon.sourceforge.net/] and Microsoft [http://www.microsoft.com/downloads/details.aspx?FamilyId=2FB55371-C94E-4373-B0E9-DB4816552E41&displaylang=en] processors. Rather than run them from the Windows command prompt, I've been using the command line interface in the jEdit text editor [http://www.jedit.org/]. There's a built in XSLT processor plug-in with jEdit, but I couldn't get it to work, hence the use of the aforementioned methods. If I understand correctly, one of the uses of this will be to take XML data about audio files generated from the JSTOR/Harvard Object Validation Environment [http://hul.harvard.edu/jhove/] (JHOVE) and map the pertinent information to another schema/XML document. That's a bit out of my league right now, but a modest start is yet a start. I'll also be interested in using transformations to make customized XML documents from MusicXML [http://www.recordare.com/xml.html] sources and Zotero [http://www.zotero.org/] exports. Admittedly, I have no real ideas as to what I'd need to do this for, but I simply have a hankering to think of related projects. Maybe pulling the lyrics out of a MusicXML document into a TEI verse [http://www.tei-c.org/release/doc/tei-p5-doc/en/html/VE.html] document?

COMMENTS

  1. nitin [2009-08-10 02:24:49]

    I forgot to mention a very practical use of XML stylesheets. And that's getting an XML document to display as tabular HTML so that the HTML display of the XML can be pasted into OpenOffice Calc, which unlike Excel doesn't natively import XML - far as I know. For more info, see: http://blog.humaneguitarist.org/?p=71