This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Conditional xsl:output ? Help
- To: DocBook-Apps <docbook-apps at lists dot oasis-open dot org>,Docbook List <docbook at lists dot oasis-open dot org>
- Subject: DOCBOOK: Conditional xsl:output ? Help
- From: Stéphane Bline <sbline at apsydev dot com>
- Date: Mon, 09 Oct 2000 08:39:14 +0200
Hello,
I'd like to use the same stylesheet to output documents of different
encoding, based on the value of the 'lang' attribute. So I figure I would
just write a small XSL construct that would do the trick and I came up with
that:
<xsl:variable name="lang-attr"
select="($target/ancestor-or-self::*/@lang
|$target/ancestor-or-self::*/@xml:lang)[last()]"/>
<xsl:choose>
<xsl:when test="string($lang-attr) = 'pl'">
<xsl:output encoding="ISO-8859-2"/>
</xsl:when>
<xsl:otherwise>
<xsl:output encoding="ISO-8859-1"/>
</xsl:otherwise>
</xsl:choose>
Unfrotunately, this does not work. Is this something that XSL can't do or am
I doing it the wrong way ?
Any help appreciated...
Regards,
Stéphane Bline.