[XML-SIG] xslt: incorporating xml with document()

Mike Brown mike@skew.org
Wed, 29 May 2002 03:01:40 -0600 (MDT)


Jed Parsons wrote:
> What can I do to ensure that elements in the included document will be 
> enuerated in the same series as elements in the original document?

The relative order of nodes from different documents is unspecified; it will
vary from processor to processor. It won't be possible to use xsl:number to
predictably generate a number that is based on the current node's position
relative to others that span multiple documents. Likewise, it won't be
possible to use position() to generate the numbers, if you were to select and
iterate over the entire cross-document node-set.

I would look at simulating the behavior of xsl:number with something else that
will dig into the included docs where necessary. I'd try it with one or two
recursive templates. It could get hairy. Given a root node of a document,
count the number of sections in that document. Process the includes in that
document by getting the root nodes of those documents and adding that to the
count you just got. Add the final result to count(ancestor::section) and add 
1?

If you get stuck again, ask on xsl-list (see www.mulberrytech.com for
info about the list).

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/