Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2008, 10:04 AM
Authorized User
 
Join Date: Feb 2008
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need to have a report(in xslt)in a following way

My report takes data in the following manner


Client Location Type Size

Clarks NY ****s 6
Clarks NY ****s 7
Clarks LosAnge ****s 8
Clarks LosAnge ****s 9
Clarks LosAnge ****s 10
Clarks LosAnge shirt 38
Clarks LosAnge shirt 39
Clarks LosAnge shirt 40

I need to group and display in such a way that the report displays like the below

Client Location Type Size

Clarks NY ****s 6
                         7
Clarks LosAnge ****s 8
                         9
                        10
Clarks LosAnge shirt 38
                         39
                         40
Basically i need to find the first group in each combination and no display the columns that are repeating in a group.Is there any way i can do this in XSLT.


 
Old July 21st, 2008, 10:08 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

If you are using XSLT 2.0 then you can simply use the <xsl:for-each-group> instruction.

Otherwise you are looking at the more complicated Muenchina method of grouping:

http://www.jenitennison.com/xslt/gro...muenchian.html

/- Sam Judson : Wrox Technical Editor -/
 
Old July 21st, 2008, 10:09 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Is the input data available as XML? Can you show us that XML?
And please state whether you want to use XSLT 2.0 or 1.0 as grouping is much easier with XSLT 2.0.

--
  Martin Honnen
  Microsoft MVP - XML
 
Old July 21st, 2008, 10:10 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

See the first post in XSLT category for links on grouping, hopefully you're using version 2.0 but it's still possible, although more tortuous, in XSLT 1.0.

--

Joe (Microsoft MVP - XML)
 
Old July 22nd, 2008, 07:56 AM
Authorized User
 
Join Date: Feb 2008
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your comments.






Similar Threads
Thread Thread Starter Forum Replies Last Post
General XSLT Questions in the XSLT Forum jminatel BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 0 March 31st, 2008 07:50 PM
Print all pages of a HTML report ,XSLT 1.0 jhansib4u XSLT 3 January 17th, 2008 11:17 AM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
xslt with an xslt outputfile alleycat XSLT 4 February 20th, 2006 09:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.