spine.xsl 807 Bytes
Newer Older
cliclac's avatar
cliclac committed
1
2
3
4
5
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"
    exclude-result-prefixes="xs"
6
    xmlns="http://www.idpf.org/2007/opf"
cliclac's avatar
cliclac committed
7
8
9
    version="2.0">
    <xsl:template name="spine">
        <spine toc="tDMncx">
cliclac's avatar
cliclac committed
10
11
            <itemref idref="titlepage"/>
            <xsl:for-each select="//section[(count(ancestor::section) = 1 and position() &gt; 1) or (count(ancestor::section) = 0)]">
cliclac's avatar
cliclac committed
12
13
14
15
                <itemref>
                    <xsl:attribute name="idref">ch_<xsl:number level="multiple" count="section" format="1_1"/></xsl:attribute>
                </itemref>
            </xsl:for-each>
cliclac's avatar
cliclac committed
16
17
        </spine>
    </xsl:template>
18
</xsl:stylesheet>