This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: loading multiple documents using variables
- From: "Thomas B. Passin" <tpassin at mitretek dot org>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 4 Apr 2002 10:24:12 -0500
- Subject: Re: [xsl] loading multiple documents using variables
- References: <5.1.0.14.0.20020404151603.009f5690@mail.unique.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
[Ralph Holz]>
>
> What I'd like to do now is load multiple documents during the
> transformation process, something like:
>
> <xsl:for-each select="doc">
> <xsl:variable name="name"><xsl:value-of select="@id"
/></xsl:variable>
> <xsl:apply-templates select="document('C:\{$name}.xml')" />
> </xsl:for-each>
>
> I'd like to use Xalan Java 2 for this.
>
> The error I get now is that document() needs a valid URI as input, and "{"
> is an offending character:
Use
<xsl:apply-templates select="document(concat('C:',\$name,'.xml')" />
Use attribute value templates (the curly brace constructions) for
constructing results, not for specifying selection.
Cheers,
Tom P
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list