<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd"><topic id="topic_s3x_dfn_qy"> <title>Testing xml:lang and font setting</title> <body>
<p>For example: <codeph xml:lang="fr-FR" outputclass="style:font-family:Arial;">€</codeph>, <codeph xml:lang="zh-CN" outputclass="style:font-family:SimHei;font-size:2em;color:red;">中国</codeph>.</p> </body></topic>
<?xml version='1.0'?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:include href="dita2fo_getFoStyle.xsl"/> <xsl:include href="dita2fo_custom_pr_domain.xsl"/> </xsl:stylesheet>
<?xml version='1.0'?><xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions" exclude-result-prefixes="xs ahf" version="2.0">
<!-- function: Expand FO style & property into attribute()* param: prmElem return: Attribute node note: XSL-FO attribute is authored in $prmElem/@outputclass using in CSS notation prefixed "style:". --> <xsl:template name="ahf:getFoProperty" as="attribute()*"> <xsl:param name="prmElem" required="no" as="element()" select="."/> <xsl:sequence select="ahf:getFoProperty($prmElem)"/> </xsl:template> <!-- function: Expand FO property into attribute()* param: prmElem return: Attribute node note: XSL-FO attribute is authored in $prmElem/@outputclass using in CSS notation prefixed "style:". --> <xsl:function name="ahf:getFoProperty" as="attribute()*"> <xsl:param name="prmElem" as="element()"/> <xsl:choose> <xsl:when test="exists($prmElem/@outputclass) and starts-with(string($prmElem/@outputclass),'style:')"> <xsl:variable name="foAttr" as="xs:string" select="normalize-space(substring(string($prmElem/@outputclass),7))"/> <xsl:for-each select="tokenize($foAttr, ';')"> <xsl:variable name="propDesc" select="normalize-space(string(.))"/> <xsl:choose> <xsl:when test="not(string($propDesc))"/> <xsl:when test="contains($propDesc,':')"> <xsl:variable name="propName" as="xs:string"> <xsl:variable name="tempPropName" as="xs:string" select="normalize-space(substring-before($propDesc,':'))"/> <xsl:variable name="axfExt" as="xs:string" select="'axf-'"/> <xsl:choose> <xsl:when test="starts-with($tempPropName,$axfExt)"> <xsl:sequence select="concat('axf:',substring-after($tempPropName,$axfExt))"/> </xsl:when> <xsl:otherwise> <xsl:sequence select="$tempPropName"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="propValue" as="xs:string" select="normalize-space(substring-after($propDesc,':'))"/> <xsl:choose> <xsl:when test="not(string($propName))"/> <!--"castable as xs:NAME" can be used only in Saxon PE or EE. If $propName does not satisfy above, xsl:attribute instruction will be faild! --> <!--xsl:when test="$propName castable as xs:NAME"--> <xsl:when test="true()"> <xsl:attribute name="{$propName}" select="$propValue"/> </xsl:when> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:message select="concat('[getFoProperty] Missing '':'' in style description. @outputclass=''',$foAttr,''' @xtrc=''',string($prmElem/@xtrc),''' @xtrf=''',string($prmElem/@xtrf),'''')"/> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:sequence select="()"/> </xsl:otherwise> </xsl:choose> </xsl:function>
</xsl:stylesheet>
<?xml version='1.0'?><xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs ahf" version="2.0">
<xsl:template match="*[contains(@class,' pr-d/codeph ')]"> <fo:inline xsl:use-attribute-sets="codeph"> <xsl:call-template name="commonattributes"/> <xsl:call-template name="ahf:getFoProperty"/> <xsl:apply-templates/> </fo:inline> </xsl:template>
</xsl:stylesheet>