← Prev in month ← Prev in thread

Auto numbering Tips

From
Halm Reusser <>
Date
2009-07-23T08:56:33+00:00
ID
Thread
Auto numbering Tips
Hello,

in my document I use some tips and warnings, like

<tip> <title> Tip- </title>
   <para>
     This the first example Tip.
   </para>
</tip>


<tip> <title> Tip- </title>
   <para>
     This the second example Tip.
   </para>
</tip>

same for warnings...


My aim is to get the Tips and Warnings auto numbered. What means after
compilation, the title should be set like Tip-01, Tip-02 etc.

For that, I wrote a small template:

<xsl:template match="tip/title">
  <xsl:text>Tip-</xsl:text>
   <xsl:variable name="tipnr">
    <xsl:number count="tip" level="any"/>
   </xsl:variable>
  <xsl:number value="$tipnr+-1" format="01"/>
</xsl:template>

It counts up, but it do not sets the title, it sets the firstline of the
paragraph text. What am I doing wrong?

Thanks in advance!

The second step, that would be perfekt, if <tip> would be rewritten to 
<tip xml:id="tip-01">. Do you know how to do it?

-Halm
← Prev in month ← Prev in thread