Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping help in XSLT !!!

Status
Not open for further replies.

killerkoolkris

Programmer
Sep 2, 2003
7
0
0
GB
Hi,
I am a newbie to XML / XSLT.

I am currently facing a problem. Below is the prototype of a XML i am using.
<xml>
<row>
<field1>1</field1>
<field2>1</field2>
<field3>1</field3>
<field4></field4>
</row>
<row>
<field1>1</field1>
<field2>1</field2>
<field3>2</field3>
<field4>1</field4>
</row>
<row>
<field1>1</field1>
<field2>1</field2>
<field3>2</field3>
<field4>2</field4>
</row>
<row>
<field1>1</field1>
<field2>1</field2>
<field3>2</field3>
<field4>3</field4>
</row>
<row>
<field1>1</field1>
<field2>2</field2>
<field3>4</field3>
<field4>1</field4>
</row>
<row>
<field1>1</field1>
<field2>2</field2>
<field3>4</field3>
<field4>2</field4>
</row>
<row>
<field1>1</field1>
<field2>2</field2>
<field3>4</field3>
<field4>3</field4>
</row>
</xml>

and the there can be any number of combinations for the field values.

The required output will be somewhat like this ....

field1 : 1
field2 : 1
field3 : 1
field3 : 2
field4 : 1
field4 : 2
field4 : 3
field2 : 2
field3 : 4
field4 : 1
field4 : 2
field4 : 3


Basically it means that i just have to take a unique combination and ignore if the value repeats.

It will be very helpful if someone can help me out
with this. I have already tried a lot of combinations but the limited ability of the <xsl:variable> is proving a big hurdle.

I hope the inputs are good and so is the problem.

Regds,
KKK ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top