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

RE: scoping inside a select statement

Subject: RE: scoping inside a select statement
From: "Wes Kubo" <wkubo@xxxxxxxxxxxxx>
Date: Wed, 12 Feb 2003 15:32:28 -0800
function in select statement
Is believe this is what you want, no? Function current() returns the current
node, which in a predicate is not the same as the context node.

  <xsl:value-of select="document('inst.xml')//*[boolean(name() =
current()/@name)]"/>

wes

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of S Woodside
Sent: Wednesday, February 12, 2003 2:46 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  scoping inside a select statement


Why does this DWIM:
  <xsl:variable name="foobar" select="@name"/>
  <xsl:value-of select="document('inst.xml')//*[boolean(name() =
$foobar)]"/>

and this doesn't:
  <xsl:value-of select="document('inst.xml')//*[boolean(name() =
@name)]"/>

... or perhaps I should say, how do I scope @name inside a select to
refer to the @name attribute of the context node outside the select,
instead of whatever it's referring to here (... an attribute named
@name in the context node inside the select?)

Also if you're wondering about the unnecessary boolean() I've decided
to use it for syntactic safety to protect myself from numeric result
s;-)

simon

---
www.simonwoodside.com

<http://ThisURLEnablesEmailToGetThroughOverzealousSpamFilters.org>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.