|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
XSLT Stylesheet DocBook -> LaTeX
|
|
Packit Service |
76cb02 |
############################################################################ -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:param name="qanda.defaultlabel">number</xsl:param>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="qandaset">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="(title|blockinfo/title|info/title)[1]"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:if test="$title">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="makeheading">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="level">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="get.sect.level"/>
|
|
Packit Service |
76cb02 |
</xsl:with-param>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="num" select="'0'"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="title" select="$title"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="qandaset/title"/>
|
|
Packit Service |
76cb02 |
<xsl:template match="qandaset/blockinfo"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
# qandadiv #
|
|
Packit Service |
76cb02 |
############ -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="qandadiv/title"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="qandadiv">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="l">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="count(ancestor::qandadiv)"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="lset">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="get.sect.level">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="n" select="ancestor::qandaset"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:if test="blockinfo/title|info/title|title">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="makeheading">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="level">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="ancestor::qandaset[title|blockinfo/title|info/title]">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$l+$lset+1"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$l+$lset"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:with-param>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
# qandaentry #
|
|
Packit Service |
76cb02 |
############## -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="label"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="qandaentry">
|
|
Packit Service |
76cb02 |
<xsl:variable name="defaultlabel">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="ancestor::qandaset[@defaultlabel]">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="ancestor::qandaset/@defaultlabel"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$qanda.defaultlabel"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
like an enumerate list
|
|
Packit Service |
76cb02 |
-->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
$defaultlabel='number'">
|
|
Packit Service |
76cb02 |
<xsl:text>
\begin{enumerate}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="question" mode="wp">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="defaultlabel" select="$defaultlabel"/>
|
|
Packit Service |
76cb02 |
</xsl:apply-templates>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="answer" mode="wp">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="defaultlabel" select="$defaultlabel"/>
|
|
Packit Service |
76cb02 |
</xsl:apply-templates>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
$defaultlabel='number'">
|
|
Packit Service |
76cb02 |
<xsl:text>
\end{enumerate}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="question" mode="wp">
|
|
Packit Service |
76cb02 |
<xsl:param name="defaultlabel"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$defaultlabel='number'">
|
|
Packit Service |
76cb02 |
<xsl:text>\item</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:if test="label">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>[\textbf{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="label"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}]</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:text>{}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="label">
|
|
Packit Service |
76cb02 |
<xsl:text>\textbf{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="label"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}~</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$defaultlabel='qanda'">
|
|
Packit Service |
76cb02 |
<xsl:text>\textbf{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="gentext">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="key" select="'question'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>}~</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>{\it </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="answer" mode="wp">
|
|
Packit Service |
76cb02 |
<xsl:param name="defaultlabel"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$defaultlabel='number'">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="label">
|
|
Packit Service |
76cb02 |
<xsl:text>
\noindent\textbf{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="label"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}~</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$defaultlabel='qanda'">
|
|
Packit Service |
76cb02 |
<xsl:text>
\noindent\textbf{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="gentext">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="key" select="'answer'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>}~</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
</xsl:stylesheet>
|