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 "Schawn E. Thropp" <th...@adlnet.org> on 2001/06/20 14:55:56 UTC

Setting Schemas?

Using Ver 1.4 of the Xerces parse it is not clear to me of how to
indicate the schema(s) to use while parsing and validating.  Since the
schemaLocation is not required in an instance document, how can
the DOMParser or SAXParser be set up to set these schemas ahead of
time.  There is no, problem of course if the the schemaLocation
attribute
is used, Xerces understands and uses the schemas. But again, it is not
required
by the W3C spec to be in and instance document.

Can you indicate to the parser what schemas to use, and if so how?

Thanks
Schawn


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


Re: Setting Schemas?

Posted by Elena Litani <el...@ca.ibm.com>.
Hi, Schawn,

There is no need to ask the question twice especially if you've got an
answer :) (see xerces-j-user list)
I've just committed code to allow you to set schemas before parse.

There are 2 new properties on the parser:
http://apache.org/xml/properties/external-schemaLocation
http://apache.org/xml/properties/external-noNamespaceSchemaLocation

I will post more information on how to use it.

Elena.

 

"Schawn E. Thropp" wrote:
> 
> Using Ver 1.4 of the Xerces parse it is not clear to me of how to
> indicate the schema(s) to use while parsing and validating.  Since the
> schemaLocation is not required in an instance document, how can
> the DOMParser or SAXParser be set up to set these schemas ahead of
> time.  There is no, problem of course if the the schemaLocation
> attribute
> is used, Xerces understands and uses the schemas. But again, it is not
> required
> by the W3C spec to be in and instance document.
> 
> Can you indicate to the parser what schemas to use, and if so how?
> 
> Thanks
> Schawn
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

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


Re: Setting Schemas?

Posted by Ian Roberts <ir...@decisionsoft.com>.
On Wed, 20 Jun 2001, Schawn E. Thropp wrote:

> Using Ver 1.4 of the Xerces parse it is not clear to me of how to
> indicate the schema(s) to use while parsing and validating.  Since the
> schemaLocation is not required in an instance document, how can
> the DOMParser or SAXParser be set up to set these schemas ahead of
> time.  There is no, problem of course if the the schemaLocation
> attribute
> is used, Xerces understands and uses the schemas. But again, it is not
> required
> by the W3C spec to be in and instance document.

It's not required by the W3C spec, but it is required by Xerces.  There is
no mechanism at present to set up the schema locations in advance (well,
not in the standard xerces code, I have put a mechanism to do this in
place in my custom version of Xerces-J 1.2.3.  Contact me off list if
you're interested).  I believe such a mechanism is planned for a future
release.

Ian

-- 
Ian Roberts, Software Engineer        DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com


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