[xsl] xsl:number usage - trying to generate multiple numbered lists for different sub-trees

Subject: [xsl] xsl:number usage - trying to generate multiple numbered lists for different sub-trees
From: James Abley <james.abley@xxxxxxxxx>
Date: Mon, 18 Oct 2010 13:33:03 +0100
Hi,

I'm trying to generate numbered links from my source document. The
transform is using <xsl:result-document/> to generate multiple output
documents from a single input document.
For each output document, I have a requirement to generate numbered
links. I think I need to use the from attribute of <xsl:number/>, but
I haven't managed to get it working.

My cut-down example is here:

http://gist.github.com/632088

Running this and looking at the generated diagnosis.html shows me that
link numbering in that file starts from 2, rather than the desired 1.
I believe is because the /article/body/symptoms/sec/p[1] element
contains an xref[@ref-type='bibr' and @rid] element.

So my thinking was that I need to specify a from attribute on the
<xsl:number/> element that matches the ancestor element which is a
child of the body element. Alternatively, I want the child of the body
element which is an ancestor of the context node.

Unfortunately, I do not seem to be able to do that; specifying the
ancestor axis in the from attribute causes an error, so I'm a little
stuck.B I can't just specify from="diagnosis" since then it won't work
for when I come to write the templates to generate the symptoms output
document. I am going to try explicitly listing the possible matches
for the from attribute; i.e. from="diagnosis | symptoms" but I don't
understand the ramifications of this fully.

Please could someone nudge me in the right direction?

Cheers,

James

Current Thread