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

RE: Problem with Muenchian grouping

Subject: RE: Problem with Muenchian grouping
From: cknell@xxxxxxxxxx
Date: Fri, 07 Nov 2003 13:11:11 -0500
jean pujol
> I'm interested in the children of <data> that have an <action> child

This XPath will locate those elements.:

/dump/data/*[action]
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     jean pujol <jean.pujol@xxxxxxxxxxxxxxx>
Sent:     Fri, 07 Nov 2003 18:29:09 +0100
To:       XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:   Problem with Muenchian grouping

Hello,

I'm a newbie at XSL, and I have a question regarding Muenchian grouping.
I've read some threads about it, but can't figure out how to solve my
problem.

My XML file looks like this:

<dump>
    <identification>
        ...
    </identification>
    <data>
        <project>
            ....
        </project>
        ...
        <projectmission>
            <action>delete</action>
             ....
        </projectmission>
        ...
        <breakdown>
            <action>update</action>
            ....
        </breakdown>
        ....
    </data>

</dump>

I'm interested in the children of <data> that have an <action> child: I
would like to group them by name and perform some processing on them.
The problem is I cannot know those names (that is, each element is
optional), and the number of elements of each category is undefined.
So I don't know how to define the <xsl:key> element that I need.
I have tried <xsl:key name="records-by-name" match="/*/*[action]"
use="name()"> but that doesn't seem to work.
Nor can I identify the elements appearing first in their "group":
my_element_name[generate-id(.) = generate-id(key('records-by-name',
name())[1])] because precisely I don't know what to put instead of
"my_element_name". I think there is a problem in the way I want to reach
the name (the tag name) of those /*/*[action] nodes. But when I replace
'name()' by 'self::name()' it raises an error (isn't 'self' a correct
axis?).

In fact I have mostly tried to adapt the example given by Dr Jenni
Tennison in the "Cocoon, sql and xslt" thread, but in my case, the
grouping is done depending on the names of the elements I want to group,
not on their children's values.

I hope my question is clear.

Thanks in advance,

Jean


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




 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.