Re: [xsl] Getting several instances to be parsed in one variable

Subject: Re: [xsl] Getting several instances to be parsed in one variable
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 13 Nov 2001 11:56:21 GMT
> so I don't want to use any extension to convert one to the 
> other.

well if you don't you are stuck.

> I thought I could use xsl:apply-templates or xsl:for-each,
no that's the whole point: a result tree fragment only has the same
operations that you can do on a string. You can't apply templates or 
for-each or extract child nodes with /.

More or less every XSLT engine has a node-set() function, and it is
likely to be implicit in later releases of XSLT so this is probably the
most portable of all extensions.

If your file had had the full names including the ".xml" then you could
have gone

<xsl:variable name="g_modules" select="document(/root/my/filenames,
  document(concat($p_my_dir, '/', /root/my/filenames[1])))"/>

where the first call to document() produces a node set of all the
documents accessed by relative URI in the filenames elements, taking a
base URI from the first of them.

This would put the root nodes of all the documents into your variable
but If the xml file has the file names without ".xml", I don't think you
can add the ".xml" and still use the feature of teh document() function
to iterate over a node set.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread