[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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. 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|