Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] for-each loop in node set variable gives error

From: "Michael Kay" <mhk@--------->
To:
Date: 9/2/2004 3:01:00 PM
Your variable $employeeList is a result tree fragment and XSLT 1.0 does not
allow you to use an RTF in a path expression. You need the xx:node-set()
extension function, or an XSLT 2.0 processor, or an XSLT 1.0 processor that
relaxes this rule.

Michael Kay
http://www.saxonica.com/

P.S. You might not be able to make sense of the error message, but there are
many people on this list who can, and who would be able to answer your
question more quickly if you quoted it.
 

> -----Original Message-----
> From: Ranjan K. Baisak [mailto:ranjanbaisak@xxxxxxxxx] 
> Sent: 02 September 2004 14:35
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] for-each loop in node set variable gives error
> 
> Hello List,
>           My stylesheet contains following
> declarations
> 
> declaration 1:
> <xsl:variable name="employeeList">
> 	<xsl:for-each select="//employee/*[name()!='max']">
> 		<xsl:if test="count(key('employee', @id))=0">
> 			<xsl:copy>
> 				<xsl:copy-of
> select="property[@name='cast']/@val"/>
> 				<xsl:copy-of select="@name"/>
> 				<xsl:copy-of 
> select="property[@name='language']"/>
> 			</xsl:copy>
> 		</xsl:if>
> 	</xsl:for-each>
> </xsl:variable>
> 
> declaration 2:
> <xsl:variable name="generatedEmployees">
> 	<xsl:for-each select="$employeeList/*">
> 		<xsl:sort select="@val"/>
> 		<xsl:copy-of select="."/>
> 	</xsl:for-each>
> </xsl:variable>
> 
> for-each loop for $employeeList/* in declaration 2
> gives error. I don't understand why it gives error.
> Any clue?
> 
> regards,
> Ranjan
> 
> 
> 		
> _______________________________
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.
> http://promotions.yahoo.com/goldrush


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent