XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
giancarlo rossiSubject: grouping a node-set
Author: giancarlo rossi
Date: 21 Oct 2006 08:02 AM
Inside a template it's builded an xml fragment:

<xsl:key name="GROUP" match="item" use="Supplier"/>

<xsl:template match="/">

<xsl:variable name="base"
<item>
<totale_finale>345</totale_finale>
<supplier>supplier1</supplier>
<totale_finale>600</totale_finale>
<supplier>supplier2</supplier>
<totale_finale>600</totale_finale>
<supplier>supplier3</supplier>
<item>
</xsl:variable>


<!--CALL THE NODESET AND GROUP IT INSIDE THIS TEMPLATE-->

<xsl:for-each select="msxsl:node-set($base)/item[generate-id(.)=generate-id(key('GROUP',Supplier))]">
<totale_finale>600</totale_finale>
test
</xsl:for-each>

<xsl:template >

in this case (it is a test)

the page is blank...

I suppose the problem is the key declaration outside the template
<xsl:key name="GROUP" match="item" use="Supplier"/>

Infact use Supplier is inside the source xml but also in the variable $base

How can i use a key declaration with a variable node-set ?

Postnext
Ivan PedruzziSubject: grouping a node-set
Author: Ivan Pedruzzi
Date: 21 Oct 2006 11:11 AM

Giancarlo,

If you want us to help you have to post the entire XSLT + XML

Ivan Pedruzzi
Stylus Studio Team

Posttop
giancarlo rossiSubject: grouping a node-set
Author: giancarlo rossi
Date: 21 Oct 2006 07:26 PM
I solve it.

it was an uppercase problem.

supplier not Supplier.

Thanks the same.
Giancarlo.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.