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

Re: use of $foo/(//path)

Subject: Re: use of $foo/(//path)
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 4 Feb 2008 21:23:50 +0000
Re:  use of $foo/(//path)
On 04/02/2008, Florent Georges <lists@xxxxxxxxxxxx> 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/

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-2007 All Rights Reserved.