Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 8th, 2007, 02:57 PM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default Value of parent element of current-grouping-key()

Hi,

Is it possible to get the attribute value of a parent of a current-grouping-key()?

for example, I have this Xpath expression:
Code:
<xsl:for-each-group group-by="." select="for $w in tokenize(string(.), '\W+') return lower-case($w)">
<xsl:sort select="count(current-group())" order="descending"/>
.......
I want the value of the ../@id

How can I do this?
  #2 (permalink)  
Old September 8th, 2007, 07:01 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The items you are grouping (and their grouping keys) are atomic values. Atomic values don't have a parent. So I've no idea what ../@id refers to.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
  #3 (permalink)  
Old September 9th, 2007, 06:29 AM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Thank you Michael.

I was trying to get the value of a parent attribute (@id) of the current grouping key...

If Atomic values don't have a parent then what I am trying to do can not work.

Thanks

Bones



Similar Threads
Thread Thread Starter Forum Replies Last Post
test if current-grouping-key() has changed? bonekrusher XSLT 4 October 24th, 2008 10:35 AM
Compare current value with previous parent node ratjetoes XSLT 2 July 17th, 2008 06:15 AM
Grouping multiple paragraph styles under 1 parent ROCXY XML 0 January 4th, 2006 09:42 AM
xpath: position parent of current node orion83 XSLT 1 September 5th, 2005 07:20 AM
Is parent first element in series cedar XSLT 2 June 8th, 2005 10:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.