Xslt As Soft Layer

Use XsltLanguage as a "soft layer"

Problem: You need to manipulate, extract, summarize, reduce, or otherwise affect data on disk or in memory. The data is inherently XML-like (either sourced from XML or destined to eventually be XML).

You may be tempted to manipulate, extract, etc. the data using the SAX or DOM API in the application language (e.g. Java, C++), especially if you already have the data in memory from a previous step.

Instead, apply an XSLT stylesheet to the data, using XSLT to AlternateHardAndSoftLayers.

You can generalize this, as in ApacheCocoon, into an XmlPipeline?, where the application language is mostly used to create "generators" for data which is then transformed by one or more XSLT transformations.

Of course, when you find a performance bottleneck or run into something that's difficult in XSLT (I think XSLT is great, but everyone hits its ceiling eventually), you can move work down to the hard layer. Even then, it's better to have the hard layer add "hints" to the XML rather than doing a lot of manipulation in the hard layer.

Examples

-- MattChaput


See also: TestingXslt


CategoryXml


EditText of this page (last edited December 12, 2004) or FindPage with title or text search