[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Grouping and numbering in XSLT 2.0,

Subject: Grouping and numbering in XSLT 2.0,
From: <geirr.prestholdt@xxxxxxxxxxxxx>
Date: Fri, 11 Nov 2005 15:16:34 +0100
xslt sequential numbering
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.