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 May 9th, 2006, 11:14 AM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT Code for Multiple occurrences

Hi I have a table like this (in XML format)

No EntityID Filed Data VarSeq
---------------------------------------
1 88 Name abc 1
2 88 Ph 123 2
3 77 Name xyz 1
4 77 Ph 456 2


I would like to display data like this

Seq Name Ph
----------------------
1 abc 123
2 xyz 456

I am very appreciate if any body provides XSLT code for this scenario

Waiting for your reply

Thanks & Regards
Vijay


 
Old May 9th, 2006, 11:23 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This is a grouping problem: you need to group the rows that have the same EntityID. For XSLT 1.0 look up Muenchian grouping (e.g. at www.jenitennison.com), for 2.0 use <xsl:for-each-group>.

Then when processing each group, you output a row that contains the Name and the Ph, which can be obtained using fairly simple path expressions.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT to make multiple hyperlinked HTML files dai.hop XSLT 1 January 11th, 2006 03:05 PM
ascii code in my XSLT bluetorch XSLT 1 October 28th, 2005 01:23 PM
Multiple XML Docs/One XSLT Stylesheet kwilliams XSLT 5 August 4th, 2005 11:54 AM
xslt with multiple occurrences in a record Olaf_l XSLT 2 April 7th, 2005 07:02 AM
Distinct Column Occurrences jemacc SQL Server 2000 2 October 25th, 2004 04:20 AM





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