Subject: Re: [xsl] global language parameter From: Charles Muller <cmuller-lst@xxxxxxxxxxxxxxx> Date: Mon, 15 Feb 2010 16:36:23 +0900 |
And when you then find after distilling all of this out that you are always building your style attribute the same way based on added attributes, you can localize the entire processing along the lines of:
<xsl:template match="p"> <p> <xsl:call-template name="add-style"/> </p> </xsl:template>
<xsl:template match="another"> <another-result> <xsl:call-template name="add-style"/> </another-result> </xsl:template>
<xsl:template name="add-style"> <xsl:attribute name="style"> <!--what is the margin component--> <xsl:choose> <xsl:when test="@render='this'"> <xsl:text>text-indent:12mm; margin-top: 0;</xsl:text> <xsl:text>margin-bottom: 0; line-height:9mm;</xsl:text> </xsl:when> <xsl:when test="@render='that'"> <xsl:text>text-indent:30mm; margin-top: 5mm;</xsl:text> <xsl:text>margin-bottom: 0; line-height:12mm;</xsl:text> </xsl:when> </xsl:choose>
<!--what is the language component-->
<xsl:choose>
<xsl:when test="lang('sa')">font-family: 'Times Ext Roman';</xsl:when>
<xsl:when test="lang('zh')"
>font-family: Mincho,MingLiU, Batang, Simsun;</xsl:when>
<xsl:when test="lang('ko')">font-family: Batang, BatangChe;</xsl:when>
</xsl:choose>
</xsl:attribute>
</xsl:template>
University of Tokyo Graduate School of Humanities and Sociology, Faculty of Letters Center for Evolving Humanities Akamon kenkyE+ tE #722 7-3-1 HongE , BunkyE -ku Tokyo 113-0033, Japan
Web Site: Resources for East Asian Language and Thought http://www.acmuller.net
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] global language parameter, G. Ken Holman | Thread | Re: [xsl] global language parameter, Charles Muller |
RE: [xsl] Can I predict the build o, Kevin Brown | Date | RE: [xsl] Can I predict the build o, Michael Kay |
Month |