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 February 28th, 2008, 11:35 PM
Authorized User
 
Join Date: Feb 2008
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to group xsl elements in xslt.10

hi all,
here is xml file.....
<root>
<Xmltype>
    <owner NAME="Legal Entity 1"></owner>
    <LegalEntity NAME="Legal Entity 1"></LegalEntity>
    <lob NAME="Line Of Business 1"></lob>
    <Formula>A</Formula>
    <Formula>B</Formula>
</Xmltype>
<Xmltype>
    <owner NAME="Legal Entity 1"></owner>
    <LegalEntity NAME="Legal Entity 1"></LegalEntity>
    <lob NAME="Line Of Business 1"></lob>
    <Formula>c</Formula>
    <Formula>D</Formula>
       <Formula>B</Formula>
</Xmltype>
<Xmltype>
    <owner NAME="Legal Entity 1"></owner>
    <LegalEntity NAME="Legal Entity 1"></LegalEntity>
    <lob NAME="Line Of Business 2"></lob>
    <Formula>A</Formula>
</Xmltype>
<Xmltype>
    <owner NAME="Legal Entity 1"></owner>
    <LegalEntity NAME="Legal Entity 1"></LegalEntity>
    <lob NAME="Line Of Business 2"></lob>
    <Formula >B</Formula>
</Xmltype>
<Xmltype>
    <owner NAME="Legal Entity 1"></owner>
    <LegalEntity NAME="Legal Entity 1"></LegalEntity>
    <lob NAME="Line Of Business 1"></lob>
    <Formula>F</Formula>
</Xmltype>

</root>

I need XSLT for this.........

I am using XSLT 1.0
I have to group according to
<owner>
<legal entity >
<lob>
output should obtain like in HTML by using XSLT:

LegalEntityOwner:Legal Entity 1
LegalEntityName:LegalEntity
LobName:Line Of Business 1
Formula:A
Formula:B
Formula:C
Formula:D
Formula:B
Formula:F

LegalEntityOwner:Legal Entity 1
LegalEntityName:LegalEntity
LobName:Line Of Business 2
Formula:A
Formula:B


pleas can any one help!!!!


 
Old February 29th, 2008, 03:44 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

If have to use XSLT 1.0 then you wll have to use Muechian Grouping: http://www.jenitennison.com/xslt/grouping/

In XSLT 2.0 it would be much easier using <xsl:for-each-group>.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Xsl: strip-space elements; and 'group-adjacent' ROCXY XSLT 6 July 15th, 2010 08:59 AM
how t do comparision of elements in xsl suji XSLT 2 February 28th, 2008 12:27 PM
first n elements with highest counts in a group manish_jaiswal XSLT 6 February 8th, 2008 09:16 PM
putting <element> round group of same elements jefke XSLT 0 May 24th, 2004 10:18 AM
how to arrange elements group wise. srini XSLT 0 February 4th, 2004 05:17 AM





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