[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: problem with position()
Hello, I'm trying to define a template to generate a particular xref label for DB->XHTML translation. I'm using this simple template: <!-- This naming style assumes that a section has at most one orderedlist child. --> <xsl:template match="d:section/d:orderedlist/d:listitem" mode="xref-to"> <xsl:param name="referrer"/> <xsl:param name="xrefstyle"/> [<xsl:value-of select="ancestor::d:section/d:titleabbrev"/>]/<xsl:copy-of select="position()"/> </xsl:template> However, this always results in a label of the form "[...]/1", i.e. the reported position is "1", no matter whether the matched listitem is actually the first or not. (Please find attached a little test doc that results in: "Some text referencing [A]/1, [A]/1, and [A]/1." (where I would expect "[A]/1, [A]/2, and [A]/3".) Does anyone see the error ? (The links themselves are correct.) Thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin...
<?xml version="1.0" encoding="UTF-8"?> <book version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <chapter> <section> <title>A title</title> <titleabbrev>A</titleabbrev> <orderedlist> <listitem xml:id="l1">L1</listitem> <listitem xml:id="l2">L2</listitem> <listitem xml:id="l3">L3</listitem> </orderedlist> <para>Some text referencing <xref linkend="l1"/>, <xref linkend="l2"/>, and <xref linkend="l3"/>.</para> </section> </chapter> </book>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]