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

Using or ignoring Types in XSLT 2.0 / XPath 2.0

Subject: Using or ignoring Types in XSLT 2.0 / XPath 2.0
From: Andrew Watt <andrew@xxxxxxxxxxxxxx>
Date: Tue, 13 May 2003 08:29:26 +0100
xpath ignore string
[I have broken this into a new thread since we were no longer talking specifically about integers and strings.]

At 00:20 13/05/2003 -0500, Mike Haarman wrote:
This thread and another recent one regarding X(Path|SL) 2.0 has raised a few
questions for me. I am late to the party and I wonder if someone can direct me
to language in the recent drafts regarding the behavior of those functions which
rely upon


http://www.w3.org/TR/xmlschema-2/

over a merely well-formed instance, that is, for which no schema is available.
In the absence of type information, the behavior of many of the functions of
XPath2.0 would seem to be indeterminate.  Where's the prose in the draft that
answers to this situation?

Mike,


You might want to take a look at the questions I posed on public-qt-comments a day or two after the new Working Drafts came out and the follow-up answers from David Carlisle and Michael Kay:

http://lists.w3.org/Archives/Public/public-qt-comments/2003May/0049.html

A key concept seems to be that strings for which there is no schema-related information are treated as xdt:untypedAtomic - an XPath/XQuery type created in response to the need for an "untyped type", if you see what I mean.

Values of the "untyped type" can be cast automatically to the desired type. Then things work as if it had been typed in the first place, assuming that the string which is of "untyped type" is castable to the type that the function expects.

So

<MySillyDate>Fred</MySillyDate>

isn't castable so causes problems if you try to treat it as a date. But if you need to treat a value as xsd:date then the following untyped data,

<MySensibleDate>2003-05-14</MySensibleDate>

should be automatically cast to the necessary type.

At the moment I am dipping into the specs as I have time, so I may have missed some important aspect of things but the above seems to be (a highly simplified version of) how things currently are drafted.

A (heretical?) thought that is beginning to float around in my mind ... Dave Pawson may approve of this :) .... is why can't we just treat untyped strings (which the WD proposes are treated as xdt:untypedAtomic) as ... well .... xsd:string types?

Andrew Watt



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.