xsl-list
[Top] [All Lists]

RE: [xsl] RE : Re: [xsl] Accessing elements with key via string in variable

2006-06-26 03:45:36
  I don't think so.  Personnaly, I use the three-parameters 
version of key() only when I need a subtree, not a document.
If I just need to set the context node for the calling point, 
I use instead:

    $input/key('things-by-a', .)

  But I guess it is a matter of taste.

I tend to use the 3-arg form. It's not just a matter of taste,

key('things-by-a', ., $input)

doesn't mean the same as

$input/key('things-by-a', .)

because the context node "." is different in the two cases, which will often
affect the evaluation of the second argument.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>