Re: multiple XML and wildcards

Subject: Re: multiple XML and wildcards
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 19 Jun 2000 11:23:26 -0600 (MDT)
> <xsl:apply-templates select="document('test.xml')//driver/meta"><xsl:sort 
> select="./title"/></xsl:apply-templates>
> What if I have a huge collection of XML files.
> I certainly do not want to type in all these names in an construction like 
> the above one.
> I would like to use some sort of wildcard.

You can't. The document() function can take a list of filenames by way of
string values of nodes in a node-set passed in as the first argument,
though. So you could put the file list in XML...

<?xml version="1.0"?>
<!-- filelist.xml -->

...and reference the file elements in it...

<xsl:variable name="files" select="document('filelist.xml')/filelist/file"/>

...then let document() pick out the string values and return the unified
node-set of all the documents in the list. You can do with the node-set
as you please..

<xsl:apply-templates select="document($files)">
  <xsl:sort select="title"/>

But there's no way to do file globbing, as I think it's called.

   - Mike
Mike J. Brown, software engineer at         My XML/XSL resources: in Denver, Colorado, USA 

 XSL-List info and archive:

Current Thread