This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: [Ann] jd.xslt - a XSLT 1.1 processor
- To: Sebastian Rahtz <sebastian dot rahtz at computing-services dot oxford dot ac dot uk>
- Subject: Re: [xsl] [Ann] jd.xslt - a XSLT 1.1 processor
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Thu, 8 Mar 2001 15:32:14 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <5.0.2.1.1.20010308140232.00a44cc0@pop.puretec.de><15015.39027.433471.754130@spqr.oucs.ox.ac.uk>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Sebastian,
> can someone tell me (and forgive my ignorance) how to make other
> processors accept stylesheets using xsl:document (assuming that they
> dont reach the code, as its in an xsl:choose case)?
If you put a version="1.1" on the xsl:stylesheet element, then the
XSLT 1.0 processor should process the stylesheet in
forwards-compatible mode, which means that it shouldn't complain just
'cos the element is there. (If you don't put version="1.1" on the
xsl:stylesheet element then it might.)
You can avoid xsl:document being instantiated by testing the version
of XSLT supported by the processor:
<xsl:choose>
<xsl:when test="system-property('xsl:version') >= 1.1">
<xsl:document>...</xsl:document>
</xsl:when>
<xsl:when test="element-available('saxon:output')">
<saxon:output>...</saxon:output>
</xsl:when>
...
<xsl:otherwise>
<xsl:message terminate="yes">
ERROR: Unable to write to other documents.
</xsl:message>
</xsl:otherwise>
</xsl:choose>
Or you can use xsl:fallback instead:
<xsl:document>
...
<xsl:fallback>
<saxon:output>
...
<xsl:fallback>
<xsl:message terminate="yes">
ERROR: Unable to write to other documents.
</xsl:message>
</xsl:fallback>
</saxon:output>
</xsl:fallback>
</xsl:document>
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list