common.xsl revision 58842e03db54033d15cc224d997f467abc88a97a
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<?xml version="1.0"?>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:stylesheet version="1.0"
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive xmlns="http://www.w3.org/1999/xhtml">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- Constants used for case translation -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- Process a documentation section -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="section">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="section/title">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\subsection*{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}</xsl:text><xsl:call-template name="label"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="section/section/title">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\subsubsection*{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}</xsl:text><xsl:call-template name="label"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="section/section/section/title">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\subsubsection*{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}</xsl:text><xsl:call-template name="label"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="note/title"></xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="example/title"></xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template name="label">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:if test="../@id">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:variable name="metafile" select="document(/*/@metafile)/metafile" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\label{</xsl:text><xsl:value-of
3fa58e00171aebf3b2cfa90035ed530f5b1f651dsliveselect="$metafile/path"/><xsl:value-of
3fa58e00171aebf3b2cfa90035ed530f5b1f651dsliveselect="$metafile/basename"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>:</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:value-of select="../@id"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:if>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- <example> -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="example">
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive<xsl:text>\par\smallskip\begin{center}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:if test="not(pre)"><xsl:text>\fbox{</xsl:text></xsl:if>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\begin{minipage}{.8\textwidth}\begin{flushleft}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates select="title" mode="print" />
01979b991e320f79fe2c1ae2afc298e8651bd69aslive<xsl:if test="not(pre)"><xsl:text>{\ttfamily\small </xsl:text></xsl:if>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\noindent </xsl:text><xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:if test="not(pre)"><xsl:text>}</xsl:text></xsl:if>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\end{flushleft}\end{minipage}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:if test="not(pre)"><xsl:text>}</xsl:text></xsl:if>
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive<xsl:text>\end{center}\par\smallskip</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="example/title" mode="print">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\textbf{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}\\ </xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- indentations -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="indent">
5e9423b4ca454c6416a2dc465dea1b1d34cec7a9slive<xsl:text>\begin{list}{}{\topsep 0pt\rightmargin 0pt\leftmargin 2em}
5e9423b4ca454c6416a2dc465dea1b1d34cec7a9slive\item[] </xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
58842e03db54033d15cc224d997f467abc88a97aslive<xsl:text>\end{list}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- <note> -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="note">
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive<xsl:text>\par\smallskip
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive{\Huge $\Longrightarrow$}\begin{minipage}[t]{.8\textwidth}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\noindent </xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates select="title" mode="print" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:apply-templates/>
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive<xsl:text>\end{minipage}\par\smallskip</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="note/title" mode="print">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\textbf{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:apply-templates/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>} \\
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\noindent </xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- <directive> -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- Inserts link to another directive, which might be in another module. -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- References are converted into lower case. -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="directive" name="directive">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>\textsc{</xsl:text>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:if test="@type='section'"><xsl:text>\textless{}</xsl:text></xsl:if>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:text>\hyperlink{/mod/</xsl:text>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:value-of select="@module"/>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:text>:</xsl:text>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:value-of select="translate(.,$uppercase,$lowercase)"/>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:text>}{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:apply-templates/>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:text>}</xsl:text>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:if test="@type='section'"><xsl:text>\textgreater{}</xsl:text></xsl:if>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- /directive -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- <module> -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- Inserts a link to refereed module -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="module" name="module">
01979b991e320f79fe2c1ae2afc298e8651bd69aslive<xsl:text>\textsc{\hyperlink{/mod/</xsl:text>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:value-of select="."/>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:text>}{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <xsl:apply-templates/>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <xsl:text>}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>}</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- /module -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- <related> -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<!-- ==================================================================== -->
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:template match="related">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\fbox{\begin{tabular}{rr}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\begin{minipage}[t]{.4\linewidth}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\textbf{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:value-of select="$messages/message[@name='relatedmodules']" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>} \\
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:for-each select="modulelist/module">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:call-template name="module"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text> \\
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:for-each>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\end{minipage} &amp;
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\begin{minipage}[t]{.4\linewidth}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\textbf{</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:value-of select="$messages/message[@name='relateddirectives']" />
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>} \\
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:for-each select="directivelist/directive">
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:call-template name="directive"/>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text> \\
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:for-each>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\end{minipage}
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive\end{tabular}}
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive\smallskip
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:text>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:template>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</xsl:stylesheet>