Subject: RE: Grouping and Sorting on value inside group
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 11 Jun 2002 17:48:40 -0400
|
Well....
At 04:40 PM 6/11/2002, Peter wrote:
I finally found the answer. Your use of [@dataid = current()/@dataid]
provided the missing clue:
<xsl:for-each select="(//dataset/*/*[generate-id() =
generate-id(key('dataids', concat(local-name(..),@dataId)))])">
<xsl:sort select="parent::node()/*[local-name() = $sortcol and
@dataId = current()/@dataId]/value"/>
...
The last step is to look at using more keys. I'd still like to know if I
can use a key or some combination of keys to eliminate the //dataset
reference in the for-each...(anyone)???
The expression
(//dataset/*/*[generate-id() =
generate-id(key('dataids', concat(local-name(..),@dataId)))])
would seem on the face of it to find the same node as
key('dataids', concat(local-name(..),@dataId))[1]
since the node inside any dataset that has the same generated ID as the
first node in the set returned by the key expression, is that node (or
nothing).
To introduce the constraint that your node must be two levels under a
dataset, you could do
key('dataids', concat(local-name(..),@dataId))[1][../parent::dataset]
... But there's only ever one such node; sorting it has no effect.
What am I missing? (I admit I'm looking at this thread late.)
Cheers,
Wendell
======================================================================
Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- Re: Grouping and Sorting on value inside group, (continued)
- TSchutzerWeissmann - Tue, 11 Jun 2002 05:46:27 -0400 (EDT)
- Hunsberger, Peter - Tue, 11 Jun 2002 13:07:39 -0400 (EDT)
- Hunsberger, Peter - Tue, 11 Jun 2002 16:52:17 -0400 (EDT)
- Wendell Piez - Tue, 11 Jun 2002 18:07:18 -0400 (EDT) <=
- Hunsberger, Peter - Tue, 11 Jun 2002 18:25:23 -0400 (EDT)
- TSchutzerWeissmann - Wed, 12 Jun 2002 05:17:23 -0400 (EDT)
- TSchutzerWeissmann - Wed, 12 Jun 2002 06:33:13 -0400 (EDT)
|
|