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

Grouping using distinct-values?

Subject: Grouping using distinct-values?
From: edmund mitchell <edmund_mitchell@xxxxxxxxxxx>
Date: Thu, 3 Jul 2008 09:53:30 -1000
 Grouping using distinct-values?
Hi all,

Struggling with my understanding of grouping, in spite of the excellent
examples in the FAQ and archives -- sorry for my thick-headedness.

Using xslt2 and saxon 9

XML is a terrible db dump:


    [SECTION NAME 9]
        10
        Common Property
        SERVICEURL_PRIMARY
        2
        https://x.y.z.net/sd


        [SECTION NAME 2]
        14
        some Property
        some name
        4
        some value


        [SECTION NAME 9]
        1
        random property
        another name
        4
        another value









I need to write name=value pairs (name being the  and value being the  for all
groups of column elements (or is it groups of record elements??) in table
name="tbl_nm" which share a like value for , sorted by the value of the column
group's .

So, the expected result for the above xml would be something like:

[SECTION NAME 9]
SERVICEURL_PRIMARY=https://x.y.z.net/sd
another name=another value
[SECTION NAME 2]
some name=some value

My thinking has been that I'll write a for loop which will identify all the
distinct property_section_nm that I have, and pass each of the distinct values
in turn to a call-template which can then group across the xml doc, and, in a
for loop of it's own, sort and then output the name=value pairs:







        $name














but I'm getting an error message that my context item:
"/database/table[@name='tbl_nm']/record[column[@name='property_section_nm' and
.=$nm]]"
isn't a node.  I've evaluated that xpath, without the variable name, and it
selects successfully...

Thanks for any hints

Edmund
_________________________________________________________________
Watch Cause Effect, a show about real people making a real difference.
Learn more.
http://im.live.com/Messenger/IM/MTV/?source=text_watchcause

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-2011 All Rights Reserved.