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 January 27th, 2011, 01:02 PM
Registered User
 
Join Date: Jan 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Combine elements question

My xml looks something like this:


Code:
<Staff>
     <Row alphakey="doejohn" building="abc" class="Algebra" />
     <Row alphakey="doejohn" building="abc" class="Geometry" />
     <Row alphakey="personbob" building="abc" class="Calculus" />
     <Row alphakey="personbob" building="abc" class="Precalc" />
...
</Staff>
And basically I need it to output like this:


Code:
Alphakey       Classes
doejohn        Algebra, Geometry
personbob      Calculus, Precalc
I've searched for how to do this with a merge, but I can't quite figure it out, and most examples look different from what I am trying to do. Can someone help me with this? Again, xslt 1.0

EDIT: I fixed the code a little, I pasted it twice.

Last edited by XadRav; January 27th, 2011 at 07:59 PM..
 
Old January 27th, 2011, 01:08 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

If you have to use XSLT 1.0 then you'll want to look at Muenchian grouping, see here for an introduction: http://www.jenitennison.com/xslt/gro...muenchian.html
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old January 27th, 2011, 09:09 PM
Registered User
 
Join Date: Jan 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Like I said in my other post, I am already using Munchian grouping, but using it a second time here is a pretty good idea, and I think it may work. I'll give it a try on Monday and report back what works, thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 16 pg 574: Elements not supported Elements not known tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 August 6th, 2009 02:48 PM
Enable/Disable Form Elements Question kwilliams Javascript 4 February 28th, 2006 11:28 AM
Beginner question on getting only certain elements EstherMStrom XSLT 5 December 10th, 2004 04:38 PM
combine 2 queries collie SQL Server 2000 2 November 29th, 2004 03:09 PM
Question on dynamic changes to other form elements savoym Javascript 1 October 27th, 2004 10:17 AM





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