xsl-list
[Top] [All Lists]

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

2011-07-26 09:11:58
Andrew,

Thanks! That worked a dream!

That was exactly what I had thought would be the problem, I just hadn't a clue 
what syntax to use to prevent it.

Thanks for your reply too David: I'm afraid I was trying to put down as little 
as would describe the problem hoping someone would spot my mistake: I'm typing 
it all in on an iPhone and it takes a long time to write code segments...

Yours,

Clint Redwood 

Screwtape Limited, Registered 06663232, Babington House, 26 College Road, 
Chilwell, Nottingham NG9 4AS

On 26 Jul 2011, at 14:47, Andrew Welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:

On 26 July 2011 14:35, Clint Redwood <clint(_at_)screwtape(_dot_)co(_dot_)uk> 
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.

Trying this out locally, it seems like it's an adjacent text node
merging issue.... if you change the $resultVar type from item()* to
xs:string* then you get the output you are after.



-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--