Project

General

Profile

root / branches / compiler / cSharp / ooasCompiler / src / libs / c5 / docNet / tolatex.xslt @ 3

1
<?xml version="1.0" ?>
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
    <xsl:output encoding = "ISO-8859-1" omit-xml-declaration="yes" indent="no"/>
4
    <xsl:strip-space elements="*"/>
5
    <xsl:template match="table">
6
        <xsl:text>\begin{tabular}{lc|*{15}{c}}\hline\hline&#10;</xsl:text>
7
        <xsl:apply-templates></xsl:apply-templates>
8
        <xsl:text>\hline\hline&#10;\end{tabular}&#10;</xsl:text>
9
    </xsl:template>
10
    <xsl:template match="tr">
11
        <xsl:choose>
12
            <xsl:when test="td/i">
13
                <xsl:text>\hline&#10;%</xsl:text><xsl:value-of select="td/i/font"/><xsl:text>&#10;</xsl:text>
14
            </xsl:when>
15
            <xsl:otherwise>
16
                <xsl:for-each select="th">
17
                    <xsl:if test="position()!=1">\turned{</xsl:if>
18
                    <xsl:apply-templates/>
19
                    <xsl:if test="position()!=1">}</xsl:if>
20
                    <xsl:if test="position()!=last()"><xsl:text disable-output-escaping="yes" >&#10;&amp;&#32;</xsl:text></xsl:if>
21
                </xsl:for-each>
22
                <xsl:for-each select="td">
23
                    <xsl:if test="position()=1">\texttt{</xsl:if>
24
                    <xsl:if test="position()!=1">$</xsl:if>
25
                    <xsl:apply-templates/>
26
                    <xsl:if test="position()=1">}</xsl:if>
27
                    <xsl:if test="position()!=1">$</xsl:if>
28
                    <xsl:if test="position()!=last()"><xsl:text disable-output-escaping="yes" >&#32;&amp;&#32;</xsl:text></xsl:if>
29
                </xsl:for-each>
30
                <!---->\\&#10;<!---->
31
            </xsl:otherwise>
32
        </xsl:choose>
33
    </xsl:template>
34
    <xsl:template match ="th">
35
        <xsl:apply-templates/>
36
    </xsl:template>
37
    <xsl:template match ="td">
38
        <xsl:apply-templates/>
39
    </xsl:template>
40
    <xsl:template match="font">
41
        <xsl:apply-templates/>
42
    </xsl:template>
43
</xsl:stylesheet>