Re: [xslt] key() in match pattern of xsl:key



On Wed, Dec 07, 2005 at 05:34:11AM -0500, Joel E. Denny wrote:
> Should it be possible to reference a key in the match pattern of another? 
> I did not find this topic addressed in the XSLT 1.0 recommendation or 
> elsewhere on the web.  Did I miss it?
> 
> libxslt's treatment of this case seems odd.  I've tested with 1.1.15. For 
> an example, please find the XML and XSLT documents at the end of this 
> message. Inside the match pattern of key `keyAnotB', the key `keyB' is 
> referenced.  If `keyAnotB' is declared before `keyB', then the key() 
> invocation for `keyB' returns the expected set of nodes.  Otherwise, it 
> returns the empty set.
> 
> Reading xsltproc -v, I see that key hashes are built in the reverse order 
> of the declarations.  That explains this behavior.  However, the opposite 
> build order seems more intuitive.  What's correct?

  I think you're reaching the limits of what the XSLT-1.0 spec specifies
and are then in "implementation specific beaviour" area. A risky place to
be in...

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]