Yes, "treat as" is there almost entirely for systems that do pessimistic
static type checking.
It can also, however, be used as an assertion mechanism, to document that
you expect a particular expression to return a particular type of value and
trigger a failure if it doesn't.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Frans Englich [mailto:frans(_dot_)englich(_at_)telia(_dot_)com]
Sent: 29 August 2005 22:07
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Usage scenarios of 'treat as'
Hi,
I'm curious on usage scenarios for the 'treat as' expression,
in particular
for when XSL-T 2.0 is the host language(if that matters).
In XPath 2.0 is verification of an operand's type(the
function conversion
rules) done at runtime(implementation dependent if guaranteed
runtime type
errors are detected statically), unless the implementation implements
"pessimistic" static type checking. (Right?)
In what case is the 'treat as' expression useful, or
required, when the
implementation does not do pessimistic, static type checking?
(that is, usage
scenarios which applies for all implementations regardless of
what optional
features that are implemented.)
From what I can tell, the 'treat as' expression is only
useful when writing
code that must work on implementations that implement
pessimistic type
checking.
Clarification, elaboration, & correction is appreciated.
Cheers,
Frans
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--