Re: [xsl] Seek an XPath expression which concatenates an arbitrary number of strings

Subject: Re: [xsl] Seek an XPath expression which concatenates an arbitrary number of strings
From: "Piez, Wendell A. (Fed) wendell.piez@xxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Mar 2024 14:48:13 -0000
Indeed, and if we're into XSLT let's also not forget xsl:apply-templates. (How
could we.)

Cheers, Wendell

From: Michael Mueller-Hillebrand michael.mueller-hillebrand@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, March 15, 2024 10:26 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Seek an XPath expression which concatenates an arbitrary
number of strings

Two more similar short options apart from the simple rewrite "binary-value =>
string-join()":

    <xsl:sequence select="binary-value/text()"/>
    <xsl:value-of select="binary-value" separator=""/>

Have fun!
Michael MH

From: David Carlisle d.p.carlisle@xxxxxxxxx<mailto:d.p.carlisle@xxxxxxxxx>
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx
rytech.com>>
Sent: Friday, March 15, 2024 2:56 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [xsl] Seek an XPath expression which concatenates an arbitrary
number of strings

string-join( binary-value,'')

On Fri, 15 Mar 2024 at 13:53, Roger L Costello
costello@xxxxxxxxx<mailto:costello@xxxxxxxxx>
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx
rytech.com>> wrote:
Hi Folks,

Eek! A basic question...

I have an XML document containing an arbitrary number of <binary-value>
elements:

<Document>
    <binary-value>0100</binary-value>
    <binary-value>11</binary-value>
    <binary-value>1010001</binary-value>
    ...
</Document>

I want an XPath expression which concatenates the binary values into one long
string:

0100111010001...

I thought this would work:

concat(for $i in //binary-value return $i)

but that gives an error, "Cannot find a 1-argument function named concat"

What is the correct XPath, please?

/Roger
XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3481519> (by
email)
XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3302254> (by
email<>)

Current Thread