xsl-list
[Top] [All Lists]

Re: [xsl] Use of separator

2006-08-07 10:18:58
On 8/7/06, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

you didn't show your input so i'll have to guess,

if the doc is

<x>
 <a>one<!-- here -->two</a>
 <a>three</a>
 <a>four</a>
</x>

and the current node is x then

element()/text() will select four text nodes with values "one" "two"
      "three" "four"
so
      <xsl:value-of select="element()/text()" separator=", "/>
will generate one text node with value
"one, two, three, four"


* will select three element nodes, each with name a and with string values
"onetwo" "three" "four" so

<xsl:value-of select="*" separator=", "/>
will generate one text node with string value
"onetwo", "three", "four"


> Now i wonder why the result of the first expression contains no
> separator while the other one does. Any explanations?
presumably it selected a sequence of length 1, but without seeing the
input it's hard to say.

Isn't it that adjacent text nodes are being merged before the
separator is applied?

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>