This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Conditional xsl:output ? Help


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]