This stylesheet is responsible for displaying the navigation pane, that is visible for example in this HTML documentation.
xsl:stylesheet id="stylesheet" exclude-result-prefixes="x2 lit xs" version="1.0" xml:lang="en" xsl:key name="labels" match="xs:label" use="@href" xsl:key name="html-uris" match="xs:html-uri" use="@href" xsl:key name="site-items" match="xs:site-item" use="@href" xsl:param name="site-map" select="'#DOES-NOT-EXIST'" xsl:param name="site-map-doc" select="document($site-map)"display-navigationtemplate xsl:template match="xs:label" xsl:template match="xs:number" Navigation menu using site maps Navigation menu without site maps Page navigation in body pane Links to related pages in HTMLhead
xsl:template match="node()" mode="navigation-from-site-map"
xsl:template match="xs:site-item" mode="navigation-from-site-map" <li> <a> xsl:attribute name="href" xsl:call-template name="map-uri" xsl:with-param name="href" select="@href" xsl:apply-templates select="xs:title[1]" mode="title-text" </a> xsl:if test="xs:site-item" <ul class="_navigation"> xsl:apply-templates select="xs:site-item" mode="navigation-from-site-map" </ul> </li>
The navigation mode
creates a navigation menu based on the nesting
of sections in the current XML document only.
xsl:template match="x2:section" mode="navigation" <li> <a> xsl:attribute name="href" xsl:text# xsl:call-template name="id" xsl:apply-templates select="x2:h" mode="title-text" </a> xsl:if test="x2:section" <ul class="_navigation"> xsl:apply-templates mode="navigation" </ul> </li>
xsl:template match="text()" mode="navigation"
xsl:template match="/" mode="navigation" <ul class="_navigation"> xsl:apply-templates mode="navigation" </ul>
xsl:template match="*" mode="navigation" xsl:apply-templates mode="navigation"
head
This is similar to Page navigation in body pane above,
but the pages are exposed as link elements
inside the HTML head.
These links may be used by web spiders, or special navigation functionality
in web browsers.
output-page-link-item: outputs one link in head
display-page-navigation: displays the navigation table
output-page-link-item: outputs one link in headxsl:template name="output-page-link-item" xsl:param name="target" xsl:param name="relation" xsl:param name="title" xsl:apply-templates select="$target/xs:title[1]" mode="title-text" xsl:if test="count($target) > 0" <link rel="{$relation}" title="{$title}"> xsl:attribute name="href" xsl:call-template name="map-uri" xsl:with-param name="href" select="$target/@href" </link>
output-page-links: outputs links in headxsl:template name="output-page-links" xsl:variable name="uri" xsl:call-template name="absolute-uri" xsl:for-each select="$site-map-doc" Get the site map nodes xsl:call-template name="output-page-link-item" xsl:with-param name="relation" select="'previous'" xsl:with-param name="target" select="$previous" xsl:call-template name="output-page-link-item" xsl:with-param name="relation" select="'up'" xsl:with-param name="target" select="$up" xsl:call-template name="output-page-link-item" xsl:with-param name="relation" select="'next'" xsl:with-param name="target" select="$next"
Formatted using xhtml2to1 by Steve Cheng.