Re: [xsl] Returning a sequence of text nodes from xsl:apply-templates

Subject: Re: [xsl] Returning a sequence of text nodes from xsl:apply-templates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 26 Jul 2011 14:48:21 +0100
On 26/07/2011 14:35, Clint Redwood wrote:
Hi! I may be fundamentally failing to understand how this works, but I've been trying to obtain a sequence result from xsl:apply-templates, where I am looking for each text result to be a member of the final sequence. There are no nodes or tags in the results.

I have

<xsl:variable name="resultVar" as="item() *">
   <xsl:apply-templates select="$nodeList" />
</xsl:variable>

As I have said, my expectation was that I would get a sequence, one entry per node in $nodeList.

However when I use

<xsl:value-of select="$resultVar" separator="$separatorVar" />

I get only a single output of all the concatenated results, without a separator.

I'm using Saxon b 9.1 and xsl 2.0.

Any suggestions as to where my understanding has failed would be appreciated.


The problem is in the code you didn't show, or in your input.


The code you didn't show, when applied to the input you didn't show, produces a result you didn't show, which must consist of a single item, or $separatorVar is empty, since the only thing we know is that $separatorVar wasn't visible in the result.

It's a bit hard to offer advice, other than the usual list advice of supplying a small, complete, example that demonstrates the problem.

David



--
google plus: https:/profiles.google.com/d.p.carlisle

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________


Current Thread