Sean,
A "<xsl:" was erronously inserted before the definition of the parameter,
which should be obvious.
The algorithm make a number of assumsions, which you might have to
correct for:
- you are using a book as the root element
- you will never have more than 999 paragraphs.
- you are only using sect1-sect5 elements in your chapter
Regards,
Jens
On Tue, 2 Aug 2005, Jens Stavnstrup wrote:
> Sean,
>
> Her is one attempt, I have been using. Both methods depends on the
> global parameter
>
> <xsl:<xsl:param name="use.para.numbering" select="1"/>
>
>
>
> For HTML/XHTML use:
>
>
> <xsl:template match="chapter/para
> |appendix/para
> |sect1/para
> |sect2/para
> |sect3/para
> |sect4/para
> |sect5/para">
> <p>
> <xsl:if test="$use.para.numbering != 0">
> <xsl:text></xsl:text>
> <xsl:number from="book"
> count="para[parent::chapter or
> parent::appendix or
> parent::sect1 or
> parent::sect2 or
> parent::sect3 or
> parent::sect4 or
> parent::sect5
> ]" format="1" level="any"/>
> <xsl:text>. </xsl:text>
> </xsl:if>
> <xsl:call-template name="anchor"/>
> <xsl:apply-templates/>
> </p>
> </xsl:template>
>
>
> For FO use:
>
>
>
> <xsl:template match="chapter/para
> |appendix/para
> |sect1/para
> |sect2/para
> |sect3/para
> |sect4/para
> |sect5/para">
> <fo:block xsl:use-attribute-sets="normal.para.spacing">
> <xsl:if test="$use.para.numbering != 0">
> <xsl:number from="book"
> count="para[parent::chapter or
> parent::appendix or
> parent::sect1 or
> parent::sect2 or
> parent::sect3 or
> parent::sect4 or
> parent::sect5]" format="111" level="any"/>
> <xsl:text>. </xsl:text>
> </xsl:if>
> <xsl:apply-templates/>
> </fo:block>
> </xsl:template>
>
>
> Regards,
>
> Jens
>
>
>
> On Tue, 2 Aug 2005, Sean Wheller wrote:
>
> > Is there a way to do numbering of paragraphs? The use case for which is legal
> > documents.
> > --
> > Sean Wheller
> >
> > http://www.enbaya.co.za