Re: [xslt] problem with key and position() function



On Mon, Mar 26, 2007 at 03:33:29PM +0200, Stéphane Mottelet wrote:
> 
> Hi folks, I am encoutering a problem when using the
> function position() with the result of a key().
[...]
>             <xsl:value-of select="position(key('match_a','second'))"/>
[...]
> Is it  a bug, or am I missing something. I would expect to get the result :
> 
> <result>2</result>

 http://www.w3.org/TR/xslt#function-key
 it returns a node-set containing the nodes in the same document as the context node that have a value for the named key equal to this string.

there would be only one element in that node set, so the position can only be 1
so what you wrote is probably not what you expected.

  http://www.w3.org/TR/xpath#function-position

does not take any argument.
Nothing replace checking the docs a bit when learning a new language

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
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]