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

Re: variable question

Subject: Re: variable question
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 11 Nov 2004 21:18:48 +0000
xsl path expressions
Hi Geert,

> Is it allowed to use a function-call at the end of a path
> expression? That must be new in XPath 2. It wasn't allowed in 1.0,
> which was a pity in some occasions as it would have prevented the
> need of the node-set function...

Yes, in XPath 2.0 *any* step in a path can be *any* kind of expression
-- these are known as "general steps", as opposed to "axis steps",
which are the normal kind we know and love.

Function calls are particularly useful, as in:

  $documents/key('mykey', $myvalue)

It's also really helpful to be able to use unions in steps, as in:

  table/(thead | tfoot)/tr

There's one restriction, though, in that general steps must return
nodes (rather than atomic values). This restriction is lifted only for
last step in a path, which can return atomic values instead (though
it's not permitted for it to return atomic values in some cases and
nodes in other cases).

In other words, you can do things like:

  keyword/lower-case(.)

but you can't do:

  keyword/lower-case(.)/substring-before(., '-')
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

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.