view software/mpdl-services-new/mpiwg-mpdl-cms/build/classes/de/mpg/mpiwg/berlin/mpdl/cms/transform/tocHtml.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
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" encoding="utf-8"/>

<xsl:param name="type"></xsl:param>

<xsl:template match="/">
  <xsl:apply-templates select="//*:list[@type = $type]/head"/>
  <xsl:apply-templates select="//*:list[@type = $type]/item"/>
</xsl:template>

<xsl:template match="*:item">
  <xsl:variable name="n" select="@n"/>
  <xsl:variable name="level" select="@lv"/>
  <div>
    <xsl:attribute name="class"><xsl:value-of select="'item'"/></xsl:attribute>
    <xsl:value-of select="concat($n, ' ')"/>
    <xsl:apply-templates/>
  </div>
</xsl:template>

<xsl:template match="*:ref">
  <xsl:variable name="o" select="@o"/>
  <span>
    <xsl:attribute name="class"><xsl:value-of select="'ref'"/></xsl:attribute>
    <xsl:value-of select="'Page: '"/>
    <xsl:apply-templates/>
  </span>
</xsl:template>

</xsl:stylesheet>