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

How to Sort, Group, sub-Total and Total in XSL

Subject: How to Sort, Group, sub-Total and Total in XSL
From: mvictor@xxxxxxxxxx
Date: Wed, 22 Nov 2000 12:46:05 -0500
xsl group total
Hello,
     I'm fairly new to XSL and I would like to produce results similar to
the following:

Product Based XSL:

Product Id: AAA
     Invoice #: 1234   Qty Ordered: 500
     Invoice #: 5678   Qty Ordered: 200
Total for Product AAA: 700

Product Id: BBB
     Invoice #: 1234   Qty Ordered: 400
Total for Product BBB: 400

Total Ordered:  1100


Invoice Based XSL:

Invoice #: 1234
     Product Id:  AAA   Qty Ordered: 500
     Product Id: BBB   Qty Ordered: 400
Total for Invoice # 1234: 900

Invoice #: 5678
     Product Id: AAA   Qty Ordered: 200
Total for Invoice # 5678: 200

Total Ordered: 1100


Both XSL documents would be based on the same XML document, similar to the
following:

<order_history>
     <order_information>
          <invoice>1234</invoice>
          <product>AAA</product>
          <qty_ordered>500</qty_ordered>
     </order_information>

     <order_information)
          <invoice>5678</invoice>
          <product>AAA</product>
          <qty_ordered>200</qty_ordered>
     </order_information>

     <order_information>
          <invoice>1234</invoice>
          <product>BBB</product>
          (qty_ordered>400</qty_ordered>
     </order_information>
</order_history>

So far, I've been able to sort the XML data in the proper order by using
<xsl:for-each select="order_information" order-by="product_id"> and the
appropriate xsl:value-of select statements.  I've found examples of how to
total two fields, but I'm not sure how to perform the required level-break
logic for the subtotals within XSL.

Can something like this be done with XSL?  I'm using  Vendor: Microsoft
Processor version: Original IE5 (or old version of other processor)

Thanks in advance for any help.




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.