[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] [Summary] 4 equivalent XPath expressions for concatenating three arguments


Subject: [xsl] [Summary] 4 equivalent XPath expressions for concatenating three arguments
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Sat, 10 Nov 2012 12:07:00 +0000

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


Current Thread
Keywords