Edwin Goei wrote:
> > Note: if application sets validation to true, but the property is
> > not specified, it is up to an implementation to decide what to validate
> > against:
> > validation may occur against DTD or XML Schemas or both.
> 
> I don't think this would be backward compatible to the previous spec
> version.  Old apps may want to validate against a DTD and expect an
> error if instance doc does not reference one.

First of all, I could not find anywhere in JAXP specs that setting
setValidation() sets validation against DTD. 
So it was parser/implementation specific. 

And it is not how it worked in Xerces 1. For Xerces1, setting validation
feature on would also set validation/schema feature on. Thus, via JAXP
users could not specify: "validate only against DTD, ignore XML Schema". 
Only if document had DTD and NO XML schema, validation errors against
DTD were reported. 
So from Jaxp users point of view, they will get the same behavior from
parser as they used to have.

 
> > >   1) app wants to validate to DTD as before. If no doctypedecl, then
> > > error.
> >
> > On factory, set validation to true and the schemaLanguage property to
> > DTD.
> > In JAXP implementation for Xerces, the parser will be created with
> > StandartParserConfiguration.
> 
> In previous version of JAXP, all that was required was to call
> setValidating(true), so this would not be backward compatible.

As I said above, setting validation to true in JAXP was also turn on
schema, so if document had no DTD but had valid XML Schema, the document
would be validated against XML Schema and user would never see any
errors against DTD. 


> >
> > >   2) app wants to validate to XSD. If no XSD association (either using
> > > doc hint or programmatically) then error.
> >
> > On factory, set validation to true and schemaLanguage property to XML
> > Schema
> > Namespace.
> > In JAXP implementation for Xerces, the parser will be created with
> > DTDXSParserConfiguration.
> 
> Sounds fine, but when I tried this w/ Xerces2 beta3, there was no error
> reported.

It works against the current code in CVS.

> >
> > >   3) app wants to validate to DTD or XSD, the case you state
> >
> > On factory, set validation to true. Language property is not specified.
> > For Xerces implementation it would mean that we create a parser with all
> > available validators (currently use DTDXSParserConfiguration).
> 
> I don't think this is backward compatible.  We may need to come up w/ a
> new schemaLanguage value for this case.

Again this is what Xerces 1 used to do. The only difference between
Xerces1 and Xerces2 in the case document has 2 grammars (DTD and XML
Schemas):
In Xerces1 we would look at the document root and if schemaLocation was
present we would ignore DTD. 
In Xerces1 if we found DTD, we won't ignore it and try to validate
against it.

Since this case is not defined by any specifications, I feel that this
change should not be a major concern.

Comments? 

--
Elena Litani / IBM Toronto

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

Reply via email to