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

Newbie question - grouping and subtotaling

Subject: Newbie question - grouping and subtotaling
From: "Sai N" <sai@xxxxxxxxxxx>
Date: Mon, 3 Dec 2001 09:09:56 -0500
xml subtotaling
Hi gurus,

I am just getting my feet wet with XML and XSLT. I have a problem that
requires transformation of some data that has rows (transformed into XML)
returned from a database into another XML that has the same rows, but has
additional rows that have subtotals.

The idea here is to be able to do the subtotals so that a VB program would
then simply read the XML document and display the report.

I have tried to plough through the MSXML 4.0 documentation and have tried
various things and have hit upong quite a few limitations of the XSLT
process.

e.g., if one tries to introduce an xml:key element, one cannot use
variables - isn't this a pain? I mean - if I wanted to write a generic XSLT
that could take any XML file with the appropriate data structure, shouldn't
I be able to apply a generic transform to convert it to another look? Isn't
that the function of XSLT?

Bear with me - I will explain my gripes.

The sample XML that I have is:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="lib_cat2.xsl"?>
<catalog>
 <group_params>
  <outer_category>book</outer_category>
  <subtotal>price</subtotal>
  <category_level1>genre</category_level1>
  <category_level2>author</category_level2>
 </group_params>
 <book id="bk101">
  <author>Gambardella, Matthew</author>
  <title>XML Developer's Guide</title>
  <genre>Computer</genre>
  <price>44.95</price>
  <publish_date>2000-10-01</publish_date>
  <description>An in-depth look at creating applications
      with XML.</description>
 </book>


I want to be able to process ANY XML with this generic format - i.e, with
the <group_params> tag followed by various groupings, followed by the actual
data.

I tried to extend the lib_cat2.xsl example that comes with the MSXML 4.0
developer's kit - and hit upon the variables limitation. The next idea was
to use parameters - but that means the XSLT has already been 'contiminated'
with data.

I guess my developer roots are starting to show through. :-)

Could anyone help me?

Note: There is no HTML whatsoever involved in all of this.


 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.