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

Temporary Trees

Subject: Temporary Trees
From: Kaine Varley <kaine.varley@xxxxxxxxxxxx>
Date: Tue, 3 Jun 2003 09:05:18 +0100
temporary trees
Hi all,

I am struggling to create and use temporary trees. The following generates
an error:

[Input]
<Folder>
	<File Name="File1" />	
	<File Name="File2" />
	<File Name="File3" />
	<File Name="File4" />
	<File Name="File5" />
</Folder>


[Stylesheet]
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.1" encoding="UTF-8"
indent="yes"/>

	<xsl:template match="Folder">
		<xsl:variable name="sorted-files">
			<xsl:for-each select="File">
				<File>
					<xsl:copy select="@*" />
				</File>
			</xsl:for-each>
		</xsl:variable>

		<xsl:for-each select="$sorted-files">
			<xsl:value-of select="@Name" /> - <xsl:value-of
select="@Position" /><BR/>
		</xsl:for-each>
	</xsl:template>


	<xsl:template match="File">
		<File>
			<xsl:copy select="@*" />
			<xsl:attribute name="Position"><xsl:value-of
select="position()" /></xsl:attribute>
		</File>
	</xsl:template>

</xsl:stylesheet>


I'm using MSXML4 (SP2), and get the following error:

	Reference to variable or parameter 'sorted-files' must evaluate to a
node list.


I have tried several methods, all have failed. Above is just one of the ways
that I have tried. I know I must be doing something wrong, but what?

Thanks,


Kaine



PROACTIS Group Limited
Holtby Manor, Stamford Bridge Road, York, YO19 5LL
Tel +44 (0)1904 481999 Fax +44 (0)1904 481666
Visit us at www.proactis.com <http://www.proactis.com/> 

PROACTIS (r) - Control spend.  Streamline purchasing.

************************************************************
The information contained in this email is intended only for the individual
to whom it is addresses.  It may contain privileged and confidential
information.  If you have received this message in error or there are any
problems, please notify the sender immediately and delete the message from
your computer.  The unauthorised use, disclosure, copying or alteration of
this message is forbidden.  PROACTIS Group Limited will not be liable for
direct, special, indirect or consequential damage as a result of any virus
being passed on, or arising from alteration of the content of this message
by a third party.
************************************************************

 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.