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

Re: [Summary] 4 equivalent XPath expressions for conc

Subject: Re: [Summary] 4 equivalent XPath expressions for concatenating three arguments
From: Adam Retter <adam.retter@xxxxxxxxxxxxxx>
Date: Sat, 10 Nov 2012 14:04:31 +0000
Re:  [Summary] 4 equivalent XPath expressions for  conc
Actually there are more than this, as in XPath 3.0, you can use "||"
as a shortcut for concat, e.g.:

'section' || ':' || 1

On 10 November 2012 12:07, Costello, Roger L. <costello@xxxxxxxxx> wrote:
> Hi Folks,
>
> Here are 4 equivalent XPath expressions for concatenating 'Section' and ': ' and 1 to produce 'Section: 1'. The latter 3 use XPath 3.0 capabilities, particularly partial function application and specifying the arity of the concat function.
>
> -----------
> XPath #1
> -----------
> concat('Section', ': ', 1)
>
> -----------
> XPath #2
> -----------
> let $concat3 := concat#3                (: Specify the arity of the concat function :)
> return $concat3('Section', ': ', 1)
>
> -----------
> XPath #3
> -----------
> let $concat3 := concat(?,?,?)           (: Partial function application :)
> return $concat3('Section', ': ', 1)
>
> -----------
> XPath #4
> -----------
> let $concat3 := concat#3('Section', ?, ?)
> return $concat3(': ', 1)
>
> /Roger
>



-- 
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

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.