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

Re: Merging multiple documents and combining their nod

Subject: Re: Merging multiple documents and combining their nodes
From: "Mark Peters" <flickrmeister@xxxxxxxxx>
Date: Wed, 13 Jun 2007 13:38:09 -0400
Re:  Merging multiple documents and combining their nod
Thanks Martin!


Is the following what you had in mind?  The first template retrieves
the components/component node-sets from the files listed in the
filenames_file.xml document. The template defines this node-set as the
temp variable.

The second template organizes the information in the temp variable.

<xsl:stylesheet version="1.0"
	<xsl:output indent="yes"/>
	<xsl:template match="/">
		<xsl:variable name="temp">
	<xsl:template match="/">
			<xsl:for-each select="exslt:node-set($temp)/components/component">
				<xsl:sort select="@name"/>
						<xsl:value-of select="@name"/>

When I apply the stylesheet, Xalan displays an error: "Could not find variable with the name of temp." I presume the error is arising because the second template cannot find the temp variable defined in the first template. Would you agree? If so, how could the issue be resolved?


in that case I'd do it in two passes, first pull in all the elements
into one tree:

<xsl:variable name="temp">

then use exslt:node-set so you can apply templates to that to do the
grouping (eg muenchian grouping using keys as described in the faq or
jeni's site. this is much easier now that all the nodes to be grouped
are siblings of each other.

<xsl:for-each select="exslt:node-set($temp)/components/component[.....


Current Thread


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.
First Name
Last Name
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.