Mercurial > hg > mpdl-group
view software/mpdl-services/mpiwg-mpdl-cms/src/de/mpg/mpiwg/berlin/mpdl/cms/transform/tocOut.xsl @ 23:e845310098ba
diverse Korrekturen
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 27 Nov 2012 12:35:19 +0100 |
parents | |
children |
line wrap: on
line source
<?xml version="1.0"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="xhtml"/> <xsl:param name="type"></xsl:param> <xsl:param name="outputFormat"></xsl:param> <xsl:template match="/"> <xsl:choose> <xsl:when test="$outputFormat = 'html'"> <xsl:apply-templates select="//*:list[@type = $type]/item" mode="html"/> </xsl:when> <xsl:otherwise> <xsl:sequence select="//*:list[@type = $type]"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="*:item" mode="html"> <xsl:variable name="n" select="@n"/> <xsl:variable name="level" select="@lv"/> <div> <xsl:attribute name="class"><xsl:value-of select="'tocItem'"/></xsl:attribute> <xsl:value-of select="concat($n, ' ')"/> <xsl:apply-templates mode="html"/> </div> </xsl:template> <xsl:template match="*:ref" mode="html"> <xsl:variable name="pageOrig" select="@o"/> <xsl:variable name="page" select="text()"/> <xsl:variable name="pageHref" select="concat('#page', $page)"/> <span> <xsl:attribute name="class"><xsl:value-of select="'tocPageRef'"/></xsl:attribute> <xsl:value-of select="'Page: '"/> <a href="{$pageHref}"><xsl:apply-templates mode="html"/></a> </span> </xsl:template> </xsl:stylesheet>