<xsl:param name="content">
<xsl:apply-templates/>
</xsl:param>
- <xsl:copy-of select="$content"/>
+
+ <xsl:choose>
+ <xsl:when test="@dir">
+ <fo:inline>
+ <xsl:attribute name="direction">
+ <xsl:choose>
+ <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+ <xsl:otherwise>rtl</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:copy-of select="$content"/>
+ </fo:inline>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$content"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template name="inline.monoseq">
<xsl:apply-templates/>
</xsl:param>
<fo:inline xsl:use-attribute-sets="monospace.properties">
+ <xsl:if test="@dir">
+ <xsl:attribute name="direction">
+ <xsl:choose>
+ <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+ <xsl:otherwise>rtl</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
<xsl:apply-templates/>
</xsl:param>
<fo:inline font-weight="bold">
+ <xsl:if test="@dir">
+ <xsl:attribute name="direction">
+ <xsl:choose>
+ <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+ <xsl:otherwise>rtl</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
<xsl:apply-templates/>
</xsl:param>
<fo:inline font-style="italic">
+ <xsl:if test="@dir">
+ <xsl:attribute name="direction">
+ <xsl:choose>
+ <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+ <xsl:otherwise>rtl</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
<xsl:apply-templates/>
</xsl:param>
<fo:inline font-weight="bold" xsl:use-attribute-sets="monospace.properties">
+ <xsl:if test="@dir">
+ <xsl:attribute name="direction">
+ <xsl:choose>
+ <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+ <xsl:otherwise>rtl</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
<xsl:apply-templates/>
</xsl:param>
<fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
+ <xsl:if test="@dir">
+ <xsl:attribute name="direction">
+ <xsl:choose>
+ <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+ <xsl:otherwise>rtl</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
<xsl:copy-of select="$content"/>
</fo:inline>
</xsl:template>
<xsl:apply-templates/>
</xsl:param>
<fo:inline>
+ <xsl:if test="@dir">
+ <xsl:attribute name="direction">
+ <xsl:choose>
+ <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+ <xsl:otherwise>rtl</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
<xsl:choose>
<xsl:when test="$fop.extensions != 0">
<xsl:attribute name="vertical-align">super</xsl:attribute>
<xsl:apply-templates/>
</xsl:param>
<fo:inline>
+ <xsl:if test="@dir">
+ <xsl:attribute name="direction">
+ <xsl:choose>
+ <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
+ <xsl:otherwise>rtl</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
<xsl:choose>
<xsl:when test="$fop.extensions != 0">
<xsl:attribute name="vertical-align">sub</xsl:attribute>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
- <span class="{local-name(.)}"><xsl:copy-of select="$content"/></span>
+ <span class="{local-name(.)}">
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$content"/>
+ </span>
</xsl:template>
<xsl:template name="inline.monoseq">
</xsl:with-param>
</xsl:call-template>
</xsl:param>
- <tt class="{local-name(.)}"><xsl:copy-of select="$content"/></tt>
+ <tt class="{local-name(.)}">
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$content"/>
+ </tt>
</xsl:template>
<xsl:template name="inline.boldseq">
</xsl:with-param>
</xsl:call-template>
</xsl:param>
- <!-- don't put <b> inside figure, example, or table titles -->
- <xsl:choose>
- <xsl:when test="local-name(..) = 'title'
- and (local-name(../..) = 'figure'
- or local-name(../..) = 'example'
- or local-name(../..) = 'table')">
- <xsl:copy-of select="$content"/>
- </xsl:when>
- <xsl:otherwise>
- <b class="{local-name(.)}"><xsl:copy-of select="$content"/></b>
- </xsl:otherwise>
- </xsl:choose>
+
+ <span>
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+
+ <!-- don't put <b> inside figure, example, or table titles -->
+ <xsl:choose>
+ <xsl:when test="local-name(..) = 'title'
+ and (local-name(../..) = 'figure'
+ or local-name(../..) = 'example'
+ or local-name(../..) = 'table')">
+ <xsl:copy-of select="$content"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <b class="{local-name(.)}">
+ <xsl:copy-of select="$content"/>
+ </b>
+ </xsl:otherwise>
+ </xsl:choose>
+ </span>
</xsl:template>
<xsl:template name="inline.italicseq">
</xsl:with-param>
</xsl:call-template>
</xsl:param>
- <i class="{local-name(.)}"><xsl:copy-of select="$content"/></i>
+ <i class="{local-name(.)}">
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$content"/>
+ </i>
</xsl:template>
<xsl:template name="inline.boldmonoseq">
or local-name(../..) = 'example'
or local-name(../..) = 'table'
or local-name(../..) = 'formalpara')">
- <tt class="{local-name(.)}"><xsl:copy-of select="$content"/></tt>
+ <tt class="{local-name(.)}">
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$content"/>
+ </tt>
</xsl:when>
<xsl:otherwise>
- <b class="{local-name(.)}"><tt><xsl:copy-of select="$content"/></tt></b>
+ <b class="{local-name(.)}">
+ <tt>
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$content"/>
+ </tt>
+ </b>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:with-param>
</xsl:call-template>
</xsl:param>
- <i class="{local-name(.)}"><tt><xsl:copy-of select="$content"/></tt></i>
+ <i class="{local-name(.)}">
+ <tt>
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$content"/>
+ </tt>
+ </i>
</xsl:template>
<xsl:template name="inline.superscriptseq">
</xsl:with-param>
</xsl:call-template>
</xsl:param>
- <sup><xsl:copy-of select="$content"/></sup>
+ <sup>
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$content"/>
+ </sup>
</xsl:template>
<xsl:template name="inline.subscriptseq">
</xsl:with-param>
</xsl:call-template>
</xsl:param>
- <sub><xsl:copy-of select="$content"/></sub>
+ <sub>
+ <xsl:if test="@dir">
+ <xsl:attribute name="dir">
+ <xsl:value-of select="@dir"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$content"/>
+ </sub>
</xsl:template>
<!-- ==================================================================== -->