[XSLT 2.0] Fallback for "as" attribute in non-schema-aware processor

One of my users (Ed Willink) has raised this interesting suggestion (I have
modified it slightly):

 

If the stylesheet specifies as="element(FOO)" which a non-schema-aware
processor currently rejects, then rather than reporting an error the
processor should instead fall back to treat it as "element()". Similarly,
as="QName?" should fall back to as="xdt:anyAtomicType?".

 

This would make it much easier to write stylesheets that work well both with
and without a schema-aware processor.

 

We could apply this purely at the XSLT level, or we could extend it to the
two XPath constructs that use a SequenceType (instance of, and treat as). In
all cases the effect would simply be to run with less type checking.

 

We could also extend this principle so that a non-schema-aware processor
ignores "type" and "validation" attributes, and xsl:import-schema, rather
than rejecting them. Perhaps such fallback behaviour should be explicitly
requested using the "switch" which we are still trying to invent.

 

Michael Kay

 

 

Received on Friday, 5 March 2004 07:07:40 UTC