comparison software/mpdl-services-new/mpiwg-mpdl-cms/src/de/mpg/mpiwg/berlin/mpdl/cms/transform/tocOut.xsl @ 25:e9fe3186670c default tip

letzter Stand eingecheckt
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 21 May 2013 10:19:32 +0200
parents
children
comparison
equal deleted inserted replaced
23:e845310098ba 25:e9fe3186670c
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet
4 version="2.0"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 >
7
8 <xsl:output method="xhtml"/>
9
10 <xsl:param name="type"></xsl:param>
11 <xsl:param name="outputFormat"></xsl:param>
12
13 <xsl:template match="/">
14 <xsl:choose>
15 <xsl:when test="$outputFormat = 'html'">
16 <xsl:apply-templates select="//*:list[@type = $type]/item" mode="html"/>
17 </xsl:when>
18 <xsl:otherwise>
19 <xsl:sequence select="//*:list[@type = $type]"/>
20 </xsl:otherwise>
21 </xsl:choose>
22 </xsl:template>
23
24 <xsl:template match="*:item" mode="html">
25 <xsl:variable name="n" select="@n"/>
26 <xsl:variable name="level" select="@lv"/>
27 <div>
28 <xsl:attribute name="class"><xsl:value-of select="'tocItem'"/></xsl:attribute>
29 <xsl:value-of select="concat($n, ' ')"/>
30 <xsl:apply-templates mode="html"/>
31 </div>
32 </xsl:template>
33
34 <xsl:template match="*:ref" mode="html">
35 <xsl:variable name="pageOrig" select="@o"/>
36 <xsl:variable name="page" select="text()"/>
37 <xsl:variable name="pageHref" select="concat('#page', $page)"/>
38 <span>
39 <xsl:attribute name="class"><xsl:value-of select="'tocPageRef'"/></xsl:attribute>
40 <xsl:value-of select="'Page: '"/>
41 <a href="{$pageHref}"><xsl:apply-templates mode="html"/></a>
42 </span>
43 </xsl:template>
44
45 </xsl:stylesheet>