| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!-- This file is part of the DITA Open Toolkit project hosted on
- Sourceforge.net. See the accompanying license.txt file for
- applicable licenses.-->
- <!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
- <xsl:stylesheet version="2.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:html="http://www.w3.org/1999/xhtml"
- exclude-result-prefixes="html">
- <!-- stylesheet imports -->
- <xsl:import href="mapwalker.xsl"/>
- <xsl:template match="*[contains(@class,' map/map ')]">
- <xsl:apply-templates select="." mode="toctop"/>
- </xsl:template>
- <xsl:template match="*[contains(@class,' map/topicref ')]" mode="process">
- <xsl:param name="infile"/>
- <xsl:param name="outroot"/>
- <xsl:param name="outfile"/>
- <xsl:param name="nodeID"/>
- <xsl:param name="isFirst"/>
- <xsl:variable name="subtopicNodes"
- select="*[contains(@class,' map/topicref ')]"/>
- <xsl:variable name="title">
- <xsl:apply-templates select="." mode="title">
- <xsl:with-param name="isFirst" select="$isFirst"/>
- <xsl:with-param name="infile" select="$infile"/>
- <xsl:with-param name="nodeID" select="$nodeID"/>
- <xsl:with-param name="outfile" select="$outfile"/>
- </xsl:apply-templates>
- </xsl:variable>
- <xsl:apply-templates select="." mode="tocentry">
- <xsl:with-param name="infile" select="$infile"/>
- <xsl:with-param name="outroot" select="$outroot"/>
- <xsl:with-param name="outfile" select="$outfile"/>
- <xsl:with-param name="nodeID" select="$nodeID"/>
- <xsl:with-param name="isFirst" select="$isFirst"/>
- <xsl:with-param name="subtopicNodes" select="$subtopicNodes"/>
- <xsl:with-param name="title" select="$title"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- required overrides -->
- <xsl:template match="*[contains(@class,' map/map ')]" mode="toctop">
- <xsl:message terminate="yes">
- <xsl:text>no toctop rule for map</xsl:text>
- </xsl:message>
- </xsl:template>
- <xsl:template match="*[contains(@class,' map/topicref ')]" mode="tocentry">
- <xsl:param name="infile"/>
- <xsl:param name="outroot"/>
- <xsl:param name="outfile"/>
- <xsl:param name="nodeID"/>
- <xsl:param name="isFirst"/>
- <xsl:param name="subtopicNodes"/>
- <xsl:param name="title"/>
- <xsl:message terminate="yes">
- <xsl:text>no tocentry rule for topicref</xsl:text>
- </xsl:message>
- </xsl:template>
- <!-- topic title -->
- <xsl:template match="*[contains(@class,' map/topicref ')]" mode="title">
- <xsl:param name="isFirst"/>
- <xsl:param name="infile"/>
- <xsl:param name="nodeID"/>
- <xsl:param name="outfile"/>
- <xsl:choose>
- <xsl:when test="*[contains(@class,'- map/topicmeta ')]/*[contains(@class, '- topic/navtitle ')]">
- <xsl:value-of select="*[contains(@class,'- map/topicmeta ')]/*[contains(@class, '- topic/navtitle ')]"/>
- </xsl:when>
- <xsl:when test="not(*[contains(@class,'- map/topicmeta ')]/*[contains(@class, '- topic/navtitle ')]) and @navtitle"><xsl:value-of select="@navtitle"/></xsl:when>
- <xsl:otherwise>
- <xsl:message>
- <xsl:text>neither title nor href</xsl:text>
- </xsl:message>
- <xsl:text></xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
|