xsl-list
[Top] [All Lists]

Re: [xsl] value-of w/separator and nodes

2007-02-02 12:25:42
Michael Kay wrote:
If you read the rules for value-of, you'll see that adjacent text nodes in
the sequence are concatenated first, before inserting the separator. So if
you have a sequence of text nodes, no separator is inserted. It's important
here to understand the subtle distinction between text nodes and strings.

The difference is necessary to ensure that you get the expected and
traditional result from something like

I must have missed it. I see it now, and it is quite clear indeed, quote: "separators are never inserted between adjacent text nodes." and, in the same example: "the content is supplied as a sequence of five text nodes, which are concatenated without space separation.".

Somehow, I found the following logic logical: take a list of items, each item has a type T. Concatenate all items by casting each type T to a string, append the separator and append to each other.

Instead, there are two rules. If type T is of a non-atomic type, there is no separator at all (I'd prefer the default separator to be the empty string, as is explained for the sequence constructor of the value-of instruction, making it possible to override this behavior, now I must resort to tedious concat()). If type T is of an atomic type, the above rule applies.

The subtleties of the language are what makes a language a language. But the subtleties are often hard to grasp or to sink in.

Thanks,
Abel

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