I agree with Glenn: the original SAX validation feature was designed for
validating parsers. Setting this feature to false, does not mean that
processor becomes non validating one.

Given that we want to preserve backwards compatibility, the solution for
this "mess" ;) would be:

1. setValidation() controls DTD validation if schema language property
is not set.
  (a) if true, processor will report DTD validation errors
  (b) if false, processor won't report validation errors, but
might/should augment the infoset.

2. If user wants to validate a document against a schema other than DTD,
s/he must setValidation() AND use the schema language property.

For example, to validate against XML Schemas users would set validation
to true as well as set schema language property to the XML Schema
namespace. As the result, validating XML processor will read DTD (to
augment the infoset), however, will perform the validation against XML
Schema. 
NOTE: this is compliant with XML Schema specification [Appendix D]:
[[
This specification requires as a precondition for �assessment� an
information set as defined in [XML-Infoset] 
]]

3. If an application receives documents with different grammars, and
wants a document to be validated against the grammar the document has,
the application must set validation to true and set language property to
value "ANY". The processor will determine against what grammar
validation will occur.

For this case, JAXP might choose to be "loose" and do not specify
exactly how the parser determines against what grammar to validate.  
In Xerces we plan to support this case as follows: if document has a
DOCTYPE document will be validated against DTD. If document does not
have DOCTYPE, the processor will attempt to validate document against
XML Schemas and report an error if no grammar was found in the document.

Summary:
--------
The new schema language property should define the value of "ANY" to
allow validation based on the grammar found in document instance.
Otherwise, the property may be set to the namespace of a schema against
which validation must occur (reporting validation errors, and infoset
augmentation if any). For both cases the validation must be set to true
(otherwise no errors will be reported).

Comments?

--
Elena Litani / IBM Toronto

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to