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 August 18th, 2005, 08:33 AM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default urgent help with xslt

hi,

I am trying to render this xml so it looks like the way I want it in HTML but I can't get anywhere with this. Could anyone be kind enough to help me figure out how to do this? At this point I am lost :(

XML:

<records>
<customer>
<id>1</id>
<name>tom</name>
<city>broon</city>
<amnt>10</amnt>
<state>sc</state>
<section>cc</section>
<recipt>ok</recipt>
</customer>

<customer>
<id>2</id>
<name>john</name>
<city>philly</city>
<amnt>50</amnt>
<state>pa</state>
<section>dd</section>
<recipt>ok</recipt>
</customer>

<customer>
<id>3</id>
<name>phil</name>
<city>dallas</city>
<amnt>100</amnt>
<state>tx</state>
<section>cc</section>
<recipt>ok</recipt>
</customer>

<customer>
<id>4</id>
<name>julian</name>
<city>menphis</city>
<amnt>133</amnt>
<state>sc</state>
<section>cc</section>
<recipt>ok</recipt>
</customer>

<customer>
<id>5</id>
<name>gloria</name>
<city>menphis</city>
<amnt>33</amnt>
<state>sc</state>
<section>dd</section>
<recipt>ok</recipt>
</customer>
</records>

and this is what I want the result to look like:

STATE: SC

SECTION: CC
ID Name Amount City Rec.PT.
1 tom 10 broon ok
4 julian 133 menphis ok

SECTION: DD
ID Name Amount City Rec.PT.
5 gloria 33 menphis ok

STATE: PA

SECTION: DD
ID Name Amount City Rec.PT.
2 John 50 philly ok

STATE: TX

SECTION: DD
ID Name Amount City Rec.PT.
3 phil 100 dallas ok


 
Old August 18th, 2005, 09:17 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Looks like a standard grouping problem. Use xsl:for-each-group in XSLT 2.0, or learn about Muenchian grouping at http://www.jenitennison.com/xslt/grouping

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 Function very urgent alapati.sasi XSLT 3 May 23rd, 2007 03:45 AM
doubt in XSLT -- very urgent subbukns XSLT 1 May 21st, 2007 05:10 PM
Query About XSLT-Urgent harshalchoksi XSLT 6 February 23rd, 2007 06:43 AM
XSLT HELP URGENT! pkg XSLT 3 June 22nd, 2005 01:46 AM
How to create forms with XSLT- urgent hums XSLT 0 September 13th, 2004 04:47 AM





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