[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

loading multiple documents using variables

Subject: loading multiple documents using variables
From: Ralph Holz <Ralph.Holz@xxxxxxxxxx>
Date: Thu, 04 Apr 2002 15:25:35 +0100
path contains invalid character xsl
Hi,

I have the following scenario here:

My XML files contains elements with "id" attributes, which serve as "links" to several files, as in this example:

<doc id="byers01" />,

where "byers01" actually refers to a file called "byers01.xml".

(Yes, there is a reason why I don't want to add the file extension in the @id. I need it elsewhere, too!)

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:

(Location of error unknown)XSLT Error (javax.xml.transform.TransformerException): javax.xml.transform.TransformerException: org.apache.xml.utils.URI$MalformedUR
IException: Path contains invalid character: {


Obviously, the $name variable is not resolved, but seen as part of the URI argument of document().

Does anyone have an idea how I can load and process multiple documents in such a for-each construction? I'd like to keep my "data format" (ids as links...) as it is.

Thanks a lot,
Ralph


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.