common.xsl revision 1c6a10274e908898347be82bc82bc7ae18c66410
beaad6ac31022179c44d88536811e9ccd9425696nd<?xml version="1.0"?>
beaad6ac31022179c44d88536811e9ccd9425696nd<xsl:stylesheet version="1.0"
beaad6ac31022179c44d88536811e9ccd9425696nd xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
db878466c5e95073429dda0bdd001f45e9486e16fielding xmlns="http://www.w3.org/1999/xhtml">
db878466c5e95073429dda0bdd001f45e9486e16fielding
db878466c5e95073429dda0bdd001f45e9486e16fielding<!-- Constants used for case translation -->
db878466c5e95073429dda0bdd001f45e9486e16fielding<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
db878466c5e95073429dda0bdd001f45e9486e16fielding<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
db878466c5e95073429dda0bdd001f45e9486e16fielding
beaad6ac31022179c44d88536811e9ccd9425696nd<!-- ==================================================================== -->
beaad6ac31022179c44d88536811e9ccd9425696nd<!-- Process a documentation section -->
beaad6ac31022179c44d88536811e9ccd9425696nd<!-- ==================================================================== -->
beaad6ac31022179c44d88536811e9ccd9425696nd<xsl:template match="section">
beaad6ac31022179c44d88536811e9ccd9425696nd<xsl:apply-templates/>
beaad6ac31022179c44d88536811e9ccd9425696nd</xsl:template>
beaad6ac31022179c44d88536811e9ccd9425696nd
beaad6ac31022179c44d88536811e9ccd9425696nd<xsl:template match="section/title">
beaad6ac31022179c44d88536811e9ccd9425696nd<xsl:text>\subsection*{</xsl:text>
beaad6ac31022179c44d88536811e9ccd9425696nd<xsl:apply-templates/>
01c674544bd4c211141bcd9fb09b96ffc18c6c3dnd<xsl:text>}</xsl:text><xsl:call-template name="label"/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>
01c674544bd4c211141bcd9fb09b96ffc18c6c3dnd</xsl:text>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele</xsl:template>
3726777f47ac4bba3e21b075905959bbea47e72eerikabele
3726777f47ac4bba3e21b075905959bbea47e72eerikabele<xsl:template match="section/section/title">
3726777f47ac4bba3e21b075905959bbea47e72eerikabele<xsl:text>\subsubsection*{</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:apply-templates/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>}</xsl:text><xsl:call-template name="label"/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:template>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template match="section/section/section/title">
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\subsubsection*{</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:apply-templates/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>}</xsl:text><xsl:call-template name="label"/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:text>
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd</xsl:template>
f1110149b5b6c28ecc39d1958d98ad9cfa8e41f3nd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template match="note/title"></xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template match="example/title"></xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template name="label">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:if test="../@id">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:variable name="metafile" select="document(/*/@metafile)/metafile" />
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\label{</xsl:text><xsl:value-of
7e68fce3cbd2246164e045a51ecd77f9f26680edndselect="$metafile/path"/><xsl:value-of
66e48875fca2df6669dab4f2690ee36c6913c0ffndselect="$metafile/basename"/>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text>:</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:value-of select="../@id"/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>}</xsl:text>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd</xsl:if>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd</xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- <example> -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:template match="example">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text>\par\smallskip\begin{center}</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:if test="not(pre)"><xsl:text>\fbox{</xsl:text></xsl:if>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\begin{minipage}{.8\textwidth}\begin{flushleft}</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:apply-templates select="title" mode="print" />
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:if test="not(pre)"><xsl:text>{\ttfamily\small </xsl:text></xsl:if>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\noindent </xsl:text><xsl:apply-templates/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:if test="not(pre)"><xsl:text>}</xsl:text></xsl:if>
8cfbcde8e416fd60132dd4324c42a5098da156cfnd<xsl:text>\end{flushleft}\end{minipage}</xsl:text>
8cfbcde8e416fd60132dd4324c42a5098da156cfnd<xsl:if test="not(pre)"><xsl:text>}</xsl:text></xsl:if>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\end{center}\par\smallskip</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template match="example/title" mode="print">
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\textbf{</xsl:text>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:apply-templates/>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text>}\\ </xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- indentations -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template match="indent">
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\begin{list}{}{\topsep 0pt\rightmargin 0pt\leftmargin 2em}
7e68fce3cbd2246164e045a51ecd77f9f26680ednd\item[] </xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:apply-templates/>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text>\end{list}</xsl:text>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd</xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- <note> -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:template match="note">
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd<xsl:text>\par\smallskip
cb7bf5cb76f4c0c5817e2cc6bc97276e425cf165nd{\Huge </xsl:text>
cb7bf5cb76f4c0c5817e2cc6bc97276e425cf165nd<xsl:choose>
cb7bf5cb76f4c0c5817e2cc6bc97276e425cf165nd<xsl:when test="@type='warning'">
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd <xsl:text>\fbox{!} </xsl:text>
cb7bf5cb76f4c0c5817e2cc6bc97276e425cf165nd</xsl:when>
cb7bf5cb76f4c0c5817e2cc6bc97276e425cf165nd<xsl:otherwise>
cb7bf5cb76f4c0c5817e2cc6bc97276e425cf165nd <xsl:text>$\Longrightarrow$</xsl:text>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd</xsl:otherwise>
4930be147adf9e3f6d3ca9313a6524f9bf654b2dnd</xsl:choose>
cb7bf5cb76f4c0c5817e2cc6bc97276e425cf165nd<xsl:text>}\begin{minipage}[t]{.8\textwidth}
cb7bf5cb76f4c0c5817e2cc6bc97276e425cf165nd\noindent </xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:apply-templates select="title" mode="print" />
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:apply-templates/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\end{minipage}\par\smallskip</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template match="note/title" mode="print">
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\textbf{</xsl:text>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:apply-templates/>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text>} \\
7e68fce3cbd2246164e045a51ecd77f9f26680ednd\noindent </xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- <directive> -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- Inserts link to another directive, which might be in another module. -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- References are converted into lower case. -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template match="directive" name="directive">
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>\textsc{</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:if test="@type='section'"><xsl:text>\textless{}</xsl:text></xsl:if>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:text>\hyperlink{/mod/</xsl:text>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="@module"/>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:text>:</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:value-of select="translate(.,$uppercase,$lowercase)"/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:text>}{</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:apply-templates/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:text>}</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:if test="@type='section'"><xsl:text>\textgreater{}</xsl:text></xsl:if>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>}</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- /directive -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- <module> -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- Inserts a link to refereed module -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:template match="module" name="module">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text>\textsc{\hyperlink{/mod/</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:value-of select="."/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:text>}{</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:apply-templates/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd <xsl:text>}</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>}</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:template>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- /module -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- <related> -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<!-- ==================================================================== -->
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:template match="related">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd\fbox{\begin{tabular}{rr}
7e68fce3cbd2246164e045a51ecd77f9f26680ednd\begin{minipage}[t]{.4\linewidth}
7e68fce3cbd2246164e045a51ecd77f9f26680ednd\textbf{</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:value-of select="$messages/message[@name='relatedmodules']" />
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text>} \\
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:for-each select="modulelist/module">
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:call-template name="module"/>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd<xsl:text> \\
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:text>
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri</xsl:for-each>
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri<xsl:text>
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri\end{minipage} &amp;
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri\begin{minipage}[t]{.4\linewidth}
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri\textbf{</xsl:text>
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri<xsl:value-of select="$messages/message[@name='relateddirectives']" />
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri<xsl:text>} \\
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri</xsl:text>
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri<xsl:for-each select="directivelist/directive">
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri<xsl:call-template name="directive"/>
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri<xsl:text> \\
9299f6420de1bc9f8cc870dd2ae5ee92f115089cdruggeri</xsl:text>
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:for-each>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd\end{minipage}
7e68fce3cbd2246164e045a51ecd77f9f26680ednd\end{tabular}}
7e68fce3cbd2246164e045a51ecd77f9f26680ednd\smallskip
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:text>
a32843995c13450ba9433b733242977cb4970265nd</xsl:template>
a32843995c13450ba9433b733242977cb4970265nd
7e68fce3cbd2246164e045a51ecd77f9f26680ednd</xsl:stylesheet>