[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: global language parameter
Charles Muller wrote:
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. I am not sure I understand what you want to achieve without seeing the input XML and the output you want to create but your text above says "making a global" parameter while here you are defining a parameter that is local to your template named "languageWrap". A global parameter is defined as a child of the xsl:stylesheet element, not inside of a template, and is used to allow to pass in a value to the transformation that can be changed each time the transformation is run. <xsl:choose> <xsl:when test="@xml:lang='sa'"> You might want to use the 'lang' function http://www.w3.org/TR/xpath/#function-lang e.g. <xsl:when test="lang('sa')"> as that way you could check for the language defined on the context node or an ancestor while your check with @xml:lang only checks the context node. <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> Show us some context where you call the above template and where we can see what the context node is and which xml:lang value it has. -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|