After some preliminary experiments, I've settled upon a two pass parser that expands the pipeline definition to embed all the imports and explicitly define all the otherwise implied port connections. Also some other handy metadata is added to help the next stage which is the compiler. The compiler takes the expanded pipeline and generate an XSLT transform that, when applied to the source document(s), will generate the desired result document(s). The parser and compiler are separate entities and the parser can run independently of the compiler as can the compiler run independently of its 'driver' transform.
I'm also expecting to be making use of the parser stage for my XProc pipeline viewer that will be generating an SVG representation of the pipeline.
I really do enjoy writing XSLT that generates XSLT, especially when it is done by interpreting some declarative XML language. There's something uniquely satisfying about taking XML, processing it with an XML programming language (XSLT) to generate some new XSLT that will execute the instructions in the original XML document. Many people call them meta-stylesheets, but because we are not styling anything I'll refer to them as meta-transforms.
I have also implemented a 'driver' transform that can take a test document from the XProc Test Suite, compile the embedded pipeline, apply it to the input document and then compare its result with the embedded output document to see if the test has passed or failed. The next step is to make an additional transform that can work across the entire test suite and generate an appropriate report document for uploading to the Results page of the XProc Test Suite website.
Thursday, 12 March 2009
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment