1 <?xml version="1.0" encoding="UTF-8"?>
3 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5 <!-- Define display/content information -->
6 <xsl:output indent="no"/>
7 <xsl:output encoding="UTF-8"/>
8 <xsl:output media-type="text/xml"/>
9 <xsl:output omit-xml-declaration="no"/>
12 <xsl:template match="/">
14 <xsl:apply-templates select="book/chapter"/>
19 <xsl:template match="/book/chapter">
21 <!-- Calculate the URL to the chapter. Store in $chapter_url -->
22 <xsl:variable name="chapter_url">
24 <xsl:when test="position()<10">
25 <xsl:value-of select="concat(/book/prepend_chapter,'ch',0,position(),'.html')"/>
28 <xsl:value-of select="concat(/book/prepend_chapter,'ch',position(),'.html')"/>
36 <xsl:value-of select="$chapter_url"/>
39 <xsl:apply-templates select="title"/>
44 <!-- Chapter/Section Title -->
45 <xsl:template match="title|chapter/title">
46 <xsl:apply-templates/>