At 2007-10-08 16:52 -0400, David Sewell wrote:
Suppose I am operating on a collection of XML documents returned by
collection("docs.xml"). Further suppose that each document node returned
by collection() contains <p> elements that I want to number sequentially
across the collection in my output. (And assume XSLT 2.0.)
My first stab at this was along these lines:
... intermediate templates ...
Output is all as desired except that the numbering is reset to 1
at each document node. Is it a built-in limitation of
xsl:number that operates within single document nodes only
XSLT 2.0 Section 12.2 reads: "based on the position of a selected
node within its containing document".
, or am I
missing some way to accomplish what I want other than putting
the whole collection into a variable like so:
and then applying templates to $wrapper? (This works fine,
I'm just wondering if it's the optimal solution.)
Seems fine to me ... and if the variable is not global then the
memory taken up by the copy of the documents when the template in
which the variable is declared ends. If, however, your wrapper is
global, then the memory will be taken up for the entire process.
I hope this helps.
. . . . . . . . . . . . . Ken
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds: publicly-available developer resources and training
G. Ken Holman mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Cancer Awareness Jul'07 http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>