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 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Chandresh GovaniSubject: XSLT Group By
Author: Chandresh Govani
Date: 07 Aug 2006 10:16 AM

I have an XML which has repeating elements (ID and Result). I need to show the results of repeating ID elements under that ID lable. (see the sample out put). I can not use the variable in XSLT to store the previous value of ID like procedure language. (and compare it to the new value and if it changes, put it under a separate label/heading). Any help will be appreciated. Thanks,


The simplified version of what I am trying to achieve.

XML:

<Observation>
<ID>One</ID>
<Result>Result Line 1</Result>
<ID>One</ID>
<Result>Result Line 2</Result>
<ID>One</ID>
<Result>Result Line 3</Result>
<ID>One</Result Line 4</Result>
<ID>Two</ID>
<Result>Result Line 1</Result>
<ID>Two</ID>
<Result>Result Line 2</Result>
<ID>Two</ID>
<Result>Result Line 3</Result>
<ID>Two</Result Line 4</Result>

Output:

One

Result Line 1. Result Line 2. Result Line 3. Result Line 4

Two

Result Line 1. Result Line 2. Result Line 3. Result Line 4

Posttop
Ivan PedruzziSubject: XSLT Group By
Author: Ivan Pedruzzi
Date: 07 Aug 2006 11:02 AM

See XSLT grouping at
http://www.jenitennison.com/xslt/grouping/

Grouping With XSLT 2.0
http://www.xml.com/pub/a/2003/11/05/tr.html

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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.