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

Re: Trying to understand root-less or document-node-le

Subject: Re: Trying to understand root-less or document-node-less nodes
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 17 Sep 2007 12:08:10 +0100
Re:  Trying to understand root-less or document-node-le
On 9/17/07, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
> Hi list people!
>
> I stumbled across this ('this' is explained later) when I realized that
>
>    <xsl:variable name="root">
>         <test1 />
>         <test2 />
>     </xsl:variable>
>
> can be queried by an xpath using the simple $root/* axis. In other
> words: children of $root. And that this felt non-analogous to the following:
>
>     <xsl:function name="my:rootless">
>         <test1 />
>         <test2 />
>     </xsl:function>

What you're describing is the same as typing the variable as="element()" eg:

<xsl:variable name="root" as="element()+">
  <test1 />
  <test2 />
</xsl:variable>

By adding as="element()+" the variable goes from a root with two child
elements that are siblings (eg to access <test1/> use $root/test1) to
a sequence of elements with no root and that aren't siblings (to
access <test1/> use $root[1])

> Thanks for any insightful insights ;)

I don't know why it's like that - I'm guessing it's because they don't
share a common parent that they aren't siblings, but I can't find
anything to back that up.

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