xsl-list
[Top] [All Lists]

Re: Concatenating multiple input documents into a single node-set

2004-05-12 08:45:53

but I only get one node in the resulting variable
In XSLT 1 if you use an xsl:variable with content then you don't get any
nodes at all, you get a result tree fragment.
If you use xsl:copy or an xx:node-set extension this result tree
fragment will act like a node set with one node, a root node (/)
that root node may have many children, in your case it will
have children being the top level elements of each of the included
documents.

If you want to get a node set consisting of all the included documents
then you can do
<xsl:variable name="collection" select="document(//rng:include/@href)"/>

as xsl:variable with a select expression doesn't generate an rtf.

Note however that if you copy this secondd form to your output you will
get the top level elements in an arbitrary order as node sets are
unordered, unlike the first case where you get them in the order
that the rng:include elements appear, as the children of the root node
are ordered along the sibling axis.

David


-- 
The LaTeX Companion
  http://www.awprofessional.com/bookstore/product.asp?isbn=0201362996
  http://www.amazon.co.uk/exec/obidos/tg/detail/-/0201362996/202-7257897-0619804


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________