[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Schema-awareness and built-in types

Subject: Re: [xsl] Schema-awareness and built-in types
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Jun 2014 20:41:03 -0000

> OK, so the reason is backwards compatibility with existing XDM
> implementations. Besides that, assuming this issue didn't exist, would
> you consider this a good feature? People who care about simple type
> safety but don't really care about complex type safety could basically
> forget about XSD and use their own little schema language/function to
> convert an untyped tree to a type-annotated one, in pure XSLT.

We're talking here about the design of subset conformance levels of the
language, i.e. conformance levels that contain some of the functionality but
not all. There will always be room for differences of opinion about how such
subsets are defined, but I think the XSLT rule that "if you're not
schema-aware, there are no type annotations on nodes" has worked pretty well,
and in fact has been adopted in XQuery 3.0 in preference to its previously
more complex rules.

Ability to work with untyped tree models such as (older) DOMs was one of the
factors but not the only one that influenced this choice.

Note also that having annotations on "simple" nodes but not on "complex" nodes
doesn't actually work very well, because the process of constructing "complex"
nodes tends by default to drop the type annotations on descendants unless
revalidation occurs at the top level.

Michael Kay

Current Thread