|
Subject: Re: [xsl] global language parameter From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 13 Feb 2010 12:04:21 -0500 |
I'm taking my first stab at making a global parameter, through which I'd like to set font attributes for character sets of different languages. I'm using TEI-P5 with XSL 2, and I want my parameter to work with xml:lang.
It tried writing this way:
<xsl:template name="languageWrap"> <xsl:param name="contents"> <xsl:apply-templates/> </xsl:param> <xsl:choose> <xsl:when test="@xml:lang='sa'"> <span style="font-family: 'Times Ext Roman'"> <xsl:copy-of select="$contents"/> </span> </xsl:when> <xsl:when test="@xml:lang='zh'"> <span style="font-family: Mincho,MingLiU, Batang, Simsun"> <xsl:copy-of select="$contents"/> </span> </xsl:when> <xsl:when test="@xml:lang='ko'"> <span style="font-family: Batang, BatangChe"> <xsl:copy-of select="$contents"/> </span> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$contents"/> </xsl:otherwise> </xsl:choose> </xsl:template>
But nothing happens in the generated HTML--there are no <span> tags generated at all in the document. Any suggestions as to what I should be looking for here?
<xsl:choose>
<xsl:when test="lang('sa')">
<span style="font-family: 'Times Ext Roman'">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:when test="lang('zh')">
<span style="font-family: Mincho,MingLiU, Batang, Simsun">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:when test="lang('ko')">
<span style="font-family: Batang, BatangChe">
<xsl:apply-templates/>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
-- XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] global language parameter, Charles Muller | Thread | Re: [xsl] global language parameter, Martin Honnen |
| [xsl] global language parameter, Charles Muller | Date | Re: [xsl] global language parameter, Martin Honnen |
| Month |