string-join

A

Al Bondy

Hi,

I'm trying to use the XSL function string-join() as explained at the
following link : http://www.w3.org/TR/xpath-functions/#func-string-join

Here is my line of code
<xsl:value-of select="string-join(('Now','is','the','time','...'),'
')" />
which returns the following error :
"System.Xml.Xsl.XsltException:
'string-join(('Now','is','the','time','...'),' ')' is an invalid XPath
expression."
I would expect the following string:
"Now is the time ..."

However, this line of code
<xsl:value-of select="concat('Now ','is ','the ','time ','...')" />
returns me the expected string, telling me that my problem is with the
string-join() function
"Now is the time ..."

But, I need to use the string-join() function...

Here is the header of my XSL file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" >

Any help will be much appreciated.
Al
 
A

Al Bondy

Thanks David,
That explains a lot.
What I actually need is a function that returns me 'n' times a string
's', which I'd like to use as follow:
<xsl:value-of select="myFnc(($s,$n)" />

Do you know if this function exists in XSLT 1.0 (couldn't find it), or
how could I write it myself ?

Thanks
Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,998
Messages
2,570,242
Members
46,834
Latest member
vina0631

Latest Threads

Top