This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 6024 - [XSLT 2++] Enhancement: modes and schema-awareness
Summary: [XSLT 2++] Enhancement: modes and schema-awareness
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-03 09:27 UTC by Michael Kay
Modified: 2011-06-08 20:38 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2008-09-03 09:27:15 UTC
The ability to take advantage of schema-awareness in XSLT 2.0 is currently limited by the fact that most of the code consists of template rules, and in a typical template rule written with match="elementname" there is no type information available statically about the type of the context node. Rewriting all the template rules to use match="schema-element(elementname)" is laborious, and only works for elements declared globally; it also makes it very difficult to maintain parallel schema-aware and non-schema-aware versions of the stylesheet.

We can reduce this problem by making schema-awareness a property of a mode.

<xsl:mode name?="mode-name" typed="no|yes|strict|lax|unspecified">

"no" means that the document will be untyped; template rules in this mode will only match nodes if they are untyped. (The system can therefore assume, for example, that atomizing an attribute node will yield a single untypedAtomic value).

"yes" means that the document will be schema-validated

"strict" means that the document will be schema-validated, and any element name used at the start of every match pattern in this mode must be the name of a global element declaration, and is interpreted as schema-element(E).

"lax" means that the document will be schema-validated, and when an element name used at the start of a match pattern corresponds to the name of a global element declaration, then it is interpreted as schema-element(E).

"unspecified" default and means don't know / don't care.
Comment 1 Michael Kay 2010-07-16 09:58:40 UTC
The WG instructed the editor to prepare spec prose to implement this proposal.
Comment 2 Michael Kay 2011-03-24 14:10:07 UTC
Status: this is implemented in the current working draft (6.6.1).
Comment 3 Michael Kay 2011-06-08 20:34:02 UTC
Closing this as we now have a design that meets the requirement in the status quo working draft.