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 4977 - Schematron queryBinding attribute
Summary: Schematron queryBinding attribute
Status: RESOLVED FIXED
Alias: None
Product: SML
Classification: Unclassified
Component: Core (show other bugs)
Version: FPWD
Hardware: PC Windows XP
: P2 normal
Target Milestone: LC
Assignee: Virginia Smith
QA Contact: SML Working Group discussion list
URL: http://www.schematron.com/spec.html
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-23 02:04 UTC by Virginia Smith
Modified: 2007-10-25 05:30 UTC (History)
0 users

See Also:


Attachments

Description Virginia Smith 2007-08-23 02:04:10 UTC
According to section 4.2.1 the queryBinding attribute is required to be "xpath 1.0" if specified. The Schematron spec states that the default queryBinding is "xslt" when none is specified. (A value of "xpath 1.0" is not defined in the spec at all.)

1 - Why should we restrict the queryBinding in SML? Perhaps we should specify it in SML-IF but is there a good reason to restrict it in SML?

2 - If we do restrict the queryBinding, it should be the default of "xslt". Other values are mentioned in the spec but are intentionally undefined. However, we can assume a value of "xpath" would eliminate xslt functions in xpath expressions.

-------from Schematron spec--------

...The optional queryBinding attribute provides the short name of the query language binding in use. If this attribute is specified, it is an error if it has a value that the current implementation does not support....

...The following query language names are reserved without further definition. Implementations which use different query language bindings are encouraged to use one of these names if appropriate : stx, xslt, xslt1.1, exslt, xslt2,
xpath, xpath2, xquery....

Also see Appendix C in spec:  A Schematron schema with no language binding or a queryBinding attribute with the value xslt, in any mix of
upper and lower case letters, shall use the following binding: ...
Comment 1 Pratul Dublish 2007-09-04 19:33:55 UTC
I think that we should specify a floor for the queryBinding in SML spec and this floor should be the default binding specified in Annex C of the Schematron spec. The floor will ensure that there is a common binding supported by all implementations and ensure that models can be exchanged without incurring the overhead of translation. Constraints are an integral part of an SML model and therefore this should be specified in the SML spec and NOT in the SML IF spec.

Using the default binding in Annex C of Schematron as the floor has the following implications on the SML spec:

1. Conforming implementations must support queryBinding="xslt"
2. Conforming implementations must use the default binding if queryBinding attribute is not specified

The default query language specified in Annex C is "extended version of XPath 1.0 as specified in XSLT spec". This adds a handful of additional functions over and above the standard XPath 1.0 functions. SML validators can use an XSLT processor to get these functions for free or implement them if they want to use an XPath 1.0 processor
Comment 2 Pratul Dublish 2007-09-04 19:39:32 UTC
The additional XPath 1.0 extension functions required by XSLT are documented at  http://www.w3.org/TR/xslt#add-func 
Comment 3 Valentina Popescu 2007-09-11 21:15:29 UTC
I think that if we have to take the floor/ceiling approach for the Schematron spec, then we should refer to [ISO/IEC 19757-3] ( which is the schematron spec referenced by the SML document ) and not make any specific references to the query language used to define the schematron rules ( simple XPath, XSLT, XQuery, and probably others to come ).

I see two options here :
1. Refer to the Schematron [ISO/IEC 19757-3] as the floor;  the normative requirements for the query languages are the responsibility of the Schemtron spec itself. 

If I read this section from the schematron spec the right way, then it seems that Schematron refers to XML1.0, XPath1.0 and XSLT1.0 as the floor:
'Normative references
The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
NOTE Each of the following documents has a unique identifier that is used to cite the document in the text. The unique identifier consists of the part of the reference up to the first comma.
W3C XML 1.0, Extensible Markup Language (XML) 1.0 (Third Edition), W3C Recommendation, 04 February 2004
XPath, XML Path Language (XPath) Version 1.0, W3C Recommendation, 16 November 1999
XSLT, XSL Transformations (XSLT) Version 1.0, W3C Recommendation, 16 November 1999'
 

2. Consciously define a floor that includes a Schematron version AND the query language. I would not suggest this approach unless the group has concrete requirements to support specific sets of XPath  extensions ( such as XSLT 1.0, 2.0, XQuery) the schematron should use.


We may need to restrict the use of the query bindings in an IF document so that we can have interop. I did not investigate this in much detail but at a minimum I think IF should require the same type of rule query bindings for all of the schematron rules packaged by that document.



Side notes for this discussion :
Note that the Schematron is defined in the spec as having a default query language:
'NOTE 1 Schematron is defined as a framework, with a default query language binding, but other query language bindings are possible.'

The default query language is set to xslt when queryBinding="xslt" or the queryBinding attribute is not specified; the Default Query Language Binding, normative Annex C section in the schematron spec, describes in detail what binding to be used when xslt is specified. ( and if you read this you notice it defines more than just XSLT 1.0 ; I don't think we want to have this type of information in our own spec) 

Comment 4 Pratul Dublish 2007-09-13 05:10:56 UTC
I think that my previous comment was misunderstood - so let me try once again. This bug is NOT about defining the current Schematron spec as the floor and allowing conforming implementations to choose future versions of Schematron. This is about defining the floor for the queryBinding attribute. IMO, choosing the floor to be the default query binding specified in the normative Annex C of Schematron spec makes sense. It gets us out of the business of specifying the query binding. 

We should also require Schematron constraints in SML IF to use the default query binding to faciliate interop.
Comment 5 Valentina Popescu 2007-09-13 15:08:35 UTC
re comment #4

Thank you for clarification Pratul

So you are proposing to set the floor in SML spec for the schematron rule binding to be the default binding as defined by the Schematron spec in Annex C ( which implies queryBinding="xslt" or queryBinding attribute not specified )

From your comment #2, I understand the rationale for doing this as :
"The floor will ensure that there is a common binding supported by all
implementations and ensure that models can be exchanged without incurring the
overhead of translation."

I think that the exchange support should be covered under the SMLIF document. So if the only reason for the fixed floor in the SML spec is to quarantee interop, then setting the query language to 'xslt' ( xslt as defined by Annex C ), should be captured under the SMLIF spec and not SML
Comment 6 Pratul Dublish 2007-09-13 16:12:10 UTC
The floor should be defined in the SML spec for exactly the same reasons that we decided to specify XML 1.0 and XSD 1.0 as floors in the SML spec.  
Comment 7 Virginia Smith 2007-10-16 20:52:17 UTC
Pratul: proposes to go with the schematron default query binding which is xslt; this should be the floor
Pratul: this statement should go in SML, not SMLIF
Resolution: consensus to fix it as mentioned above
Comment 8 Kumar Pandit 2007-10-25 05:30:58 UTC
revised the text as follows:


If the queryBinding attribute is not specified, then its value is assumed to be set to "xslt". Conforming implementations MUST support the "xslt" query binding. Conforming implementations MAY additionally support query bindings other than "xslt".