You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Elena Litani <el...@ca.ibm.com> on 2002/06/10 16:29:00 UTC

Re: Validating without parsing

Dennis Thrysoe - Netnord A/S wrote:
> > I expect more discussion on revalidation design on xerces-j-dev list.
> > If you are interested, please subscribe to this list.
> 
> Actually I'm only searching for the best way to instantiate an
> XMLSchemaValidator or XMLDTDValidator, specify some named resource to
> load the grammar from, and the rest *should* be a breeze...
> 
> Does anybody have any good suggestions or pointers for relevant
> documentation?

Not yet, this is a new feature.

Here are couple of suggestions on how to validate against XMLSchema:

1) Create your own parser configuration that includes all the
features/properties needed by XMLSchemaValidator. 
The configuration is needed, so you can easily reset()
XMLSchemaValidator. For examples, see dom.DOMRevalidationConfiguration. 

2) To specify location of the schema, you could:
   a) Use properties:
http://apache.org/xml/properties/schema/external-schemaLocation and 
     
http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation
   b) specify schemaLocation attributes at the root element

3) XMLSchemaValidator also implements impl.RevalidationHandler that
allows you to set baseURI relative to which the resolution of schema
location should occur. The handler also has an additional method to pass
characters as strings (instead of XMLString).

Note: this is experimental code: the implementation can be
changed/removed or modified. (So you might need to change your code in
the future..)


-- 
Elena Litani / IBM Toronto

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org