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

RE: functions and sequences

Subject: RE: functions and sequences
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 13 Dec 2004 09:35:50 -0000
xsl text function
> I've also run into this issue.

Yes, it's a common experience. We've made a few changes in the latest draft
to alleviate some of the problems - specifically, adjustments to the rules
on when whitespace gets added as a separator.
> 
> While it is perfectly understandable, it is a major change from
> XSLT/XPath 1.0 where it was not allowed to have two immediate
> text-node siblings.

It still isn't allowed to have two adjacent text-node siblings! The real
problem is that when people write

<xsl:text>A</xsl:text>
<xsl:text>B</xsl:text>

they are accustomed to think in terms of creating text nodes that are
children of an element, and which are therefore immediately concatenated.
But if you aren't creating an element at the time, you are creating a
sequence of two text nodes, which aren't siblings of each other, and which
can therefore exist quite independently.

> I think it would be good to support the following in order to avoid
> inconvenience and confusion:
> 
>    -  Allow an xs:string() constructor, which takes a sequence of
> xs:strings or a sequence of text nodes; This will allow a function of
> type xs:string to automatically convert a sequence of
> strings/text-nodes to a single string return value.
> 
>    - Provide an overload of the concat() function, which takes a
> single argument of type sequence of xs:string or sequence of text
> nodes.

This operation can already be done conveniently using the <xsl:value-of>
instruction in XSLT, or the string-join() function in XPath.

Michael Kay
http://www.saxonica.com/

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.