Actually I do not understand how multiple schema locations can be specified
and also multiple nonamespace locations.
Is setExternalSchemaLocation a URI or a flag?

I could have a document validating against a.dtd, b.xsd, c.xsd(namespace X),
d.xsd(namespace Y).

What I want to do is I have all these grammars loaded and I want to the
parser to run in validating mode and ignore all
references made in the instance document.

So if the XML has a1.dtd c1.xsd(namespace X) it should ignore it and only
use the preloaded grammars.
I can have a entity resolver to not return empty strings for all namespaces
and nonamespaces but will the parser look at the
preloaded DTD/Schema grammars.
Also these are in (DTD and schemas) are in memory so I cannot use a URI to
reference them in setExternalSchemaLocation 

Thanks
Kiran

-----Original Message-----
From: Neil Graham [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 3:24 PM
To: [EMAIL PROTECTED]
Subject: Re: LAX Validation


Hi Kiran,

For question 1, I'm not sure I follow what you need.  Are you after some
kind of feature that will validate an element if it can find a declaration
for that element, but ignore it if it can't?  i.e., if your schema has
global element a, b, and c, no local element decls, and your document
instance contains <d/>, you want that not to be considered?  If that's in
any way right, then no, there's certainly no way to do this.  You're best
bet is to specify <xs:any processContents="skip"/> wherever you could
possibly have undeclared elements.

As to your second question, the standard approach is to use the
http://apache.org/xml/properties/external-schema-location property to bind
a list of location hints to the list of namespaces you'll be using, then
register an entity resolver on the parser and return  input sources that
contain empty streams.  That way you're guaranteed the parser won't try and
resolve anythig on its own.

Hope that helps,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  [EMAIL PROTECTED]




|---------+---------------------------->
|         |           "Bagepalli,      |
|         |           Kiran"           |
|         |           <[EMAIL PROTECTED]|
|         |           matica.com>      |
|         |                            |
|         |           04/01/2003 04:39 |
|         |           PM               |
|         |           Please respond to|
|         |           xerces-c-dev     |
|         |                            |
|---------+---------------------------->
 
>---------------------------------------------------------------------------
------------------------------------------------------------------|
  |
|
  |       To:       "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
|
  |       cc:
|
  |       Subject:  LAX Validation
|
  |
|
  |
|
 
>---------------------------------------------------------------------------
------------------------------------------------------------------|



1. Is there any way I could run the parser with Lax validation. I just want
to ignore elements which are not a part of the schema. I know schemas
allows
the 'any' content with lax validation. I am looking for something more
general than that.

2. Is there a way I could force the parser to ONLY use the preloaded
grammar. This is like saying ignore all grammar(DTD/Schema) specified in
the
document and use the grammar that was explicitly loaded.

Thanks





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





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


 


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

Reply via email to