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 Ian Roberts <ir...@decisionsoft.com> on 2000/10/16 14:14:40 UTC

Validating documents against a specific schema

Hi,

Is there any way to specify the schema that Xerces-J is to validate
documents against, other than by using schemaLocation attributes in the
instance document?  I am working on a system in which third parties submit
XML files for validation, and I need to be able to specify that the files
are validated against my schema, rather than letting the document specify
its own schema.

Ian

-- 
Ian Roberts                     | irr@decisionsoft.com
DecisionSoft Ltd.               | http://www.decisionsoft.com/

XMLScript XML transcoding technology - http://www.xmlscript.org/


Re: Validating documents against a specific schema

Posted by Jerry Lawson <je...@virtualsummit.com>.
I have done this by implementing the EntityResolver
interface, then using the parser's setEntityResolver()
method to plug in my implementation of the entity resolver.
My implementation of EntityResolver.resolvEntity(String,String)
does its own look-up logic based on database definition.
If the look-up fails, I return null.
Yours could be provided with a specific schema filename
when it is instantiated, and return a corresponding InputSource
based on that pre-defined filename.


Ian Roberts wrote:
> 
> Hi,
> 
> Is there any way to specify the schema that Xerces-J is to validate
> documents against, other than by using schemaLocation attributes in the
> instance document?  I am working on a system in which third parties submit
> XML files for validation, and I need to be able to specify that the files
> are validated against my schema, rather than letting the document specify
> its own schema.
> 
> Ian
> 
> --
> Ian Roberts                     | irr@decisionsoft.com
> DecisionSoft Ltd.               | http://www.decisionsoft.com/
> 
> XMLScript XML transcoding technology - http://www.xmlscript.org/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

-- 
___________________________________________________
Jerry Lawson                   Virtual Summit, Inc.
Virtual Programmer   jerry.lawson@virtualsummit.com