[Home] [By Thread] [By Date] [Recent Entries]
Dave Pawson wrote:
Andrews solution is good, but outputs
<!-- Collate all blocks (== title, para* ) --> <xsl:variable name="blocks"> <xsl:for-each-group select="/book/*" group-starting-with="*[self::title]"> <block> <xsl:copy-of select="current-group()"/> </block> </xsl:for-each-group> </xsl:variable> <xsl:variable name="nested"> <xsl:call-template name="nest"> <xsl:with-param name="nodes" select="$blocks//block[not(position() = 1)]"/> </xsl:call-template> </xsl:variable> <xsl:apply-templates select="$nested/*"/> </bk> </xsl:template>
Many thanks Andrew. Numbering now matches the spec <bk>
<block sect="1">
<title>Introduction</title>
</block>
<block sect="1.1">
<title>Introduction</title>
<para>This document defines an XML schema for ....</para>
<para>The schema provides for high-level infor ....</para>
<para>Chapter 1 contains the introduction to t ....</para>
<para>Chapter 8 describes the table content of ....</para>
<para>The OpenDocument format makes use of a p ....</para>
</block>
<block sect="1.2">
<title>Notation</title>
<para>Within this specification, the key words ....</para>
</block>regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk
|

Cart



