|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Grouping and numbering in XSLT 2.0,
I have an XML report like the one below. I want to group vendor-data by
vendor. I have no number to use as grouping key, but as you can
understand each vendor has one name, one cage etc. The result I want is
listed at the end.
If I could assign a sequential number to each <value> within each
<cell>, and then use this number as grouping key, I believe the problem
can be solved.
I cant just figure out how to this in one XSLT style sheet.
Source list:
<?xml version="1.0" encoding="UTF-8"?>
<vendors>
<cell name="Company">
<value>AMPHENOL AEROSPACE OPERATIONS</value>
<value>ITT CANNON</value>
<value>SOURIAU CONNECTION TECHNOLOGY (FCI)</value>
<value>DEUTSCH ECD</value>
<value>AERO ELECTRIC CONNECTOR INC</value>
<value>AMPHENOL CORPORATION</value>
<value>TEC ELECTRICAL COMPONENTS LTD</value>
</cell>
<cell name="Cage">
<value>77820</value>
<value>71468</value>
<value>F0225</value>
<value>11139</value>
<value>59976</value>
<value>74868</value>
<value>K0690</value>
</cell>
<cell name="Address">
<value/>
<value/>
<value/>
<value/>
<value>TORRANCE</value>
<value/>
<value/>
</cell>
</vendors>
Preferred result:
<?xml version="1.0" encoding="UTF-8"?>
<Vendors>
<vendor>
<cell name="Company">
<value>AMPHENOL AEROSPACE OPERATIONS</value>
</cell>
<cell name="Cage">
<value>77820</value>
</cell>
<cell name="Address">
<value/>
</cell>
</vendor>
<vendor>
<cell name="Company">
<value>ITT CANNON</value>
</cell>
<cell name="Cage">
<value>71468</value>
</cell>
<cell name="Address">
<value/>
</cell>
</vendor>
<vendor>
<cell name="Company">
<value>SOURIAU CONNECTION TECHNOLOGY (FCI)</value>
</cell>
<cell name="Cage">
<value>F0225</value>
</cell>
<cell name="Address">
<value/>
</cell>
</vendor>
<vendor>
<cell name="Company">
<value>DEUTSCH ECD</value>
</cell>
<cell name="Cage">
<value>11139</value>
</cell>
<cell name="Address">
<value/>
</cell>
</vendor>
<vendor>
<cell name="Company">
<value>AERO ELECTRIC CONNECTOR INC</value>
</cell>
<cell name="Cage">
<value>59976</value>
</cell>
<cell name="Address">
<value>TORRANCE</value>
</cell>
</vendor>
<vendor>
<cell name="Company">
<value>AMPHENOL CORPORATION</value>
</cell>
<cell name="Cage">
<value>74868</value>
</cell>
<cell name="Address">
<value/>
</cell>
</vendor>
<vendor>
<cell name="Company">
<value>TEC ELECTRICAL COMPONENTS LTD</value>
</cell>
<cell name="Cage">
<value>K0690</value>
</cell>
<cell name="Address">
<value/>
</cell>
</vendor>
</Vendors>
Regards Geirr
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








