At 15.35 01/04/2003 -0800, you wrote:
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).

It's a sequence of pairs (URI,location); for instance, you can invoke setExternalSchemaLocation("X c.xsd Y d.xsd")
You could preload the DTD by calling
getScanner()->loadGrammar("a.dtd",Grammar::DTDGrammarType,true);



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.

Once you have already associated the X namespace with c.xsd, the c1.xsd file will be ignored (Xerces only allows one schema document for each namespace)
If I remember right, once you have preloaded the schemas, the external DTD is ignored (and you should get an error if the XML document contains an internal subset)


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

In this case, use getScanner()->loadGrammar(myMemBufInputSource,Grammar::DTDGrammarType,true); for the DTD and getScanner()->loadGrammar(myMemBufInputSource,Grammar::SchemaGrammarType,true); for the XMLSchema

Coming back to the other problem (the lax validation), you can call setValidationConstraintFatal(false), so that elements that have no schema will not be validated but they will not force the parsing to abort.

Alberto



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



Reply via email to