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

RE: XSLT 2.0 empty string

Subject: RE: XSLT 2.0 empty string
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 28 Feb 2005 14:53:10 -0000
empty xs string
> I think the point of the example was that the expectation was that the
> variable didn't have a set (sequence) semantic but rather was a string
> as if string($f) had been applied, due to the as attribute on the
> xsl:variable (which is a 2.0 feature of course).

The variable was defined as:

<xsl:variable name="foo" select="nothing" as="xs:string?"/>

The select expression yields a node-sequence, the as expression requires
atomic values, so XSLT invokes atomization. The result of atomizing an empty
node-sequence is an empty sequence of strings. 
> 
> But I think it's true to say that as="xs:string" does _not_ force an
> empty sequence to coerce to an empty string, isn't it?

The only conversions forced by the "as" attribute are atomization and
numeric promotion (e.g. int to double). It doesn't cause a cast. If the "as"
attribute had said "xs:string" rather than "xs:string?", a type error would
be reported.

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.