Using or ignoring Types in XSLT 2.0 / XPath 2.0
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
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:
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.
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,
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?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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