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

Re: Question about variable definition and types

Subject: Re: Question about variable definition and types
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 7 Mar 2008 10:20:31 +0000
Re:  Question about variable definition and types
On 06/03/2008, Jim Garrison <Jim.Garrison@xxxxxxxxx> wrote:
>
>
>  >    The presence of the attribute "as" determines whether the value of
>  > the variable is evaluated to a sequence or a temporary tree
>
>
> [snip]
>
>  Ah.... thanks for the explanation.  That clears up a lot :-)

It's worth adding the when you do as="element()+" the elements
represented by that variable aren't siblings because they don't have a
common parent.

So:

<xsl:variable name="foo">
  <a/>
  <b/>
</xsl:variable>

here a/following-sibling::b returns true


<xsl:variable name="foo" as="element()+">
  <a/>
  <b/>
</xsl:variable>

here a/following-sibling::b returns false

...so it's worth bearing that in mind when deciding what the as
attribute should be.

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