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

Re: current() within a key element's @use

Subject: Re: current() within a key element's @use
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 28 Dec 2012 15:28:24 +0000
Re:  current() within a key element's @use
On 24/12/2012 00:24, John P. McCaskey wrote:
I have found inconsistent behavior when using current() in the use attribute of a key element.

Shouldn't these
    <xsl:key name="keyUsingCurrent"   match="color" use="current()/@id"/>
    <xsl:key name="keyWithoutCurrent" match="color" use="@id"/>
produce the same set of keys?

Yes, it should. The spec says: "For an outermost expression (an expression not occurring within another expression), the current node is always the same as the context node.".


The XSLT 1.0 spec is not terribly explicit about what what the current node is in other situations, but the examples it gives lead one to infer that it should be the same as for the outermost containing expression.

>Am I witnessing a bug in code that xsltproc, Chrome and Safari share? If so, to whom would I report such a bug? Would doing so make any difference? >

Yes, don't know, and probably not.

Michael Kay
Saxonica

I need current() to work inside @use, so that I can have an attribute such as
use="../tagUsage[@render=current()/@xml:id]/@gi". See http://stackoverflow.com/questions/13984167/create-xsl-key-by-joining-elements. If this is a bug, is there a workaround?


Thanks for any help.

-- JPM

John P. McCaskey, mailbox@xxxxxxxxxxxxxxxx

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.