xsl-list
[Top] [All Lists]

Re: [xsl] use of $foo/(//path)

2008-02-04 14:24:20
On 04/02/2008, Florent Georges <lists(_at_)fgeorges(_dot_)org> wrote:
Andrew Welch wrote:

Sorry David I've read that a few times and still can't see how you
would get different results - any chance you could explain it again
:0)

  Input:

    <root>
      <video id='v1'/>
      <actor>
        <video id='v2'/>
      </actor>
    </root>

with $actor bound to /root/actor:

    $actor//video/@id   (: -> v2 :)
    $actor(//video/@id) (: -> v1, v2 :)

  In the first case, the video is a descendant of actor.  In the second
case, they are descendants of the document the actor belongs to.

ahh that explains it, and helps explains David's answer as well.

$actor/(//video/@id)

is the same as

$actor/root()//video/@id

At the moment I think I prefer the longer syntax...


thanks
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
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>