[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: value-of w/separator and nodes

Subject: Re: value-of w/separator and nodes
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 02 Feb 2007 20:24:03 +0100
Re:  value-of w/separator and nodes
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.