[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

  • To: <xml-dev@l...>
  • Subject: ANN: RELAX NG to Compact Syntax Presentation in HTML (and XSLT Processor Implementer Challenge)
  • From: "David Rosenborg" <darolst@p...>
  • Date: Fri, 7 Feb 2003 15:04:52 +0100

pantor
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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.