|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
XSLT Stylesheet DocBook -> LaTeX
|
|
Packit |
0f19cf |
############################################################################ -->
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template name="scape" >
|
|
Packit |
0f19cf |
<xsl:param name="string"/>
|
|
Packit |
0f19cf |
<xsl:call-template name="tex-format">
|
|
Packit |
0f19cf |
<xsl:with-param name="string" select="$string"/>
|
|
Packit |
0f19cf |
</xsl:call-template>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template name="tex-format">
|
|
Packit |
0f19cf |
<xsl:param name="string"/>
|
|
Packit |
0f19cf |
<xsl:call-template name="special-replace">
|
|
Packit |
0f19cf |
<xsl:with-param name="i">1</xsl:with-param>
|
|
Packit |
0f19cf |
<xsl:with-param name="mapfile" select="document('texmap.xml')"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="string" select="$string"/>
|
|
Packit |
0f19cf |
</xsl:call-template>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template name="special-replace">
|
|
Packit |
0f19cf |
<xsl:param name="i"/>
|
|
Packit |
0f19cf |
<xsl:param name="mapfile"/>
|
|
Packit |
0f19cf |
<xsl:param name="string"/>
|
|
Packit |
0f19cf |
<xsl:choose>
|
|
Packit |
0f19cf |
<xsl:when test="($mapfile/mapping/map[position()=$i])[1]">
|
|
Packit |
0f19cf |
<xsl:variable name="map" select="($mapfile/mapping/map[position()=$i])[1]"/>
|
|
Packit |
0f19cf |
<xsl:call-template name="string-replace">
|
|
Packit |
0f19cf |
<xsl:with-param name="to">
|
|
Packit |
0f19cf |
<xsl:value-of select="$map/@text"/></xsl:with-param>
|
|
Packit |
0f19cf |
<xsl:with-param name="from">
|
|
Packit |
0f19cf |
<xsl:value-of select="$map/@key"/></xsl:with-param>
|
|
Packit |
0f19cf |
<xsl:with-param name="string">
|
|
Packit |
0f19cf |
<xsl:call-template name="special-replace">
|
|
Packit |
0f19cf |
<xsl:with-param name="i" select="$i+1"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="mapfile" select="$mapfile"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="string" select="$string"/>
|
|
Packit |
0f19cf |
</xsl:call-template>
|
|
Packit |
0f19cf |
</xsl:with-param>
|
|
Packit |
0f19cf |
</xsl:call-template>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:otherwise>
|
|
Packit |
0f19cf |
<xsl:value-of select="$string"/>
|
|
Packit |
0f19cf |
</xsl:otherwise>
|
|
Packit |
0f19cf |
</xsl:choose>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template name="sec-map">
|
|
Packit |
0f19cf |
<xsl:param name="keyword"/>
|
|
Packit |
0f19cf |
<xsl:param name="name" select="local-name(.)"/>
|
|
Packit |
0f19cf |
<xsl:variable name="mapfile" select="document('secmap.xml')"/>
|
|
Packit |
0f19cf |
<xsl:variable name="to" select="($mapfile/mapping/map[@key=$keyword])[1]/@text"/>
|
|
Packit |
0f19cf |
<xsl:if test="$to=''">
|
|
Packit |
0f19cf |
<xsl:message>*** No mapping for <xsl:value-of select="$keyword"/></xsl:message>
|
|
Packit |
0f19cf |
</xsl:if>
|
|
Packit |
0f19cf |
<xsl:value-of select="$to"/>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
</xsl:stylesheet>
|