XSLT = XML the WO Way?


I need to be able to present a (potentially interactive) HTML page that is created from an XML file (such as an IMS, DublinCore, METS...). The way I had been doing it was with object modelling - convert the XML file into a set of objects, similar to EOs - relations and all - and then feeding those objects into custom WOComponents for display.

Turns out, there is a much better way. Simply create an .xsl file that contains the logic for each schema (or set of schemas, if similar enough), and just feed the results of the XSLT transformation into a single WOComponent. Very cool stuff.

This basically means that I can have themed metadata presentation (and navigation of content) without having to modify and java code. Customization can be done on the fly, by people who don't have access to the source code.

I've got a simple test case where I convert any IMS record into an HTML page presenting the details about that record. Easy peasy. Next, to embed the transformation into a WebObjects application, and test it out there.

I've come across two challenges with this approach so far. First, the IMS schema (1.2.2) contains an invalid namespace, so java xml parsers choke when validating. I should be able to turn off validation once in WO. I'm using jEdit to create and test the .xsl file, so I don't have access to the namespace property.

Second, most of the metadata schemas use the non-xml version of the VCARD specification. Unless I can figure out a way to process VCARD data within the XSL file, I may be hooped here. The Old Way, I just created a java class that understood the VCARD spec and ripped out relevant bits of data. I'll keep plugging away at this...


xml 

See Also

comments powered by Disqus