[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] loading multiple documents using variables
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|