> The key to retrieve the grammar is the namespace of the
> schema so what you do wont work.
I don't underastand why it will not work. This is short example of my
XML file:
<Root>
<SomeNode>Some text...</SomNode>
<ds:Signature>...</ds:Signature>
</Root>
I have three schemas:
1. First schema defines elements (Root, SomeNode...) that belongs to
default namespace.
2. Second chema defines elemnts that belongs to "ds" namespace (XML
Signature elements).
3. Third schema defines elements that belongs to xds namespace (XAdES
elements, we can ignore it at present).
The problem is that I can't verify my XML document against those 3
schemas, because first schema doesn't have "target namespace".
This is how I load schemas:
XercesDOMParser * parser = new XercesDOMParser;
parser->setDoNamespaces(true);
parser->setCreateEntityReferenceNodes(true);
MemBufInputSource * is = new MemBufInputSource(schema, schemaLen,
"MySchema");
parser->loadGrammar(*is, Grammar::SchemaGrammarType, true);
parser->setDoSchema(true);
parser->setValidationSchemaFullChecking(true);
parser->setValidationScheme(XercesDOMParser::Val_Always);
parser->useCachedGrammarInParse(true);
parser->parse("C:\\My.xml");
If I use setExternalNoNamespaceSchemaLocation("C:\\MySchema.xsd")
instead of loadGrammar() it works fine (doesn't report any errors).
I think this is a bug in Xerces?
Best regards,
Milan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]