[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] ANN: RELAX NG to Compact Syntax Presentation in HTML (and XSLT Processor
Hi! I've updated the stylesheets for RELAX NG XML syntax to compact syntax conversion. New in the 1.4 release is a stylesheet for HTML presentation. The stylesheet has the following features: * Recursively converts input schemas to compact syntax, i.e., handles include and externalRef * Links from pattern references to definitions * Links from pattern definitions to a generated index with back references This stylesheet and stylesheets for plain text output are available in the RngToRnc package at http://www.pantor.com/download.html Here is a small example: http://www.pantor.com/rncexample.html The new stylesheets use a two step conversion. First the main XML syntax to compact syntax conversion is handled by the RngToRncXml.xsl stylesheet. The output is an intermediate XML format. This format is then converted into either HTML or plain text using the RngToRncHtml.xsl or RngToRncText.xsl stylesheets. If your XSLT processor provides a result tree fragment to node set conversion function, like exslt:node-set (), the two steps can be carried out up on a single invocation. See comments in the stylesheets for further details. Caveats: The RngToRnc stylesheets make use of two features that causes portability problems: advance namespace processing and r-t-f to node set conversion. Some of the problems I've encountered was handled by disabling features depending on the return value of system-property ('xsl:vendor'). In general, large schemas are more problematic than small ones. If you want to convert to plain text and have problems with a large schema, you could try the RngToRncClassic.xsl stylesheet which is a bit simpler. XSLT Processor Implementer Challenge: The challenge is to convert the office.rng schema in the following package http://lists.oasis-open.org/archives/office/200301/zip00000.zip to HTML using a single invocation of RngToRncHtml.xsl with the retain-prefixes stylesheet parameter set to true. I've successfully done this with a processor implemented in Java. It took 12 seconds on a 1.53GHz Athlon box, running RedHat 7.2. The time isn't really that important as long as it is within your patience limits ... I've tested the same setup with Saxon 6.5.2 (never returns), Xalan-J 2.4 (never returns), MSXSL 4.0 (on win2k, crashes) and xsltproc 20423/10019/701 (on RH8, 10 min, partial output). 'Never returns' means that my patience run out after 15 min or so. If you set retain-prefixes to false, Xalan works acceptable and MSXSL works very well, but xsltproc still produces partial output: it doesn't create the index section. (I think the problem in xsltproc is that it mixes up what is the current document when finding the root node and looking up key values.) Saxon works well for small schemas in this mode, but seems to have problems with the exslt:node-set () function for large schemas. Admittedly, my namespace processing expressions aren't pretty, and could maybe be simplified to be kinder to the processor, but nonetheless, I expected that the most popular processors should do better than they apparently do. Cheers, David ------------------------------------------ David Rosenborg Pantor Engineering AB
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|