Milan,

"Milan Tomic" <[EMAIL PROTECTED]> writes:

> 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).

Does it work if you use

InputSource * is = new LocalFileInputSource("C:\\MySchema.xsd");

instead of

InputSource * is = new MemBufInputSource(schema, schemaLen, "MySchema");

?

If so then you may want to try to pass something like "C:\\MySchema.xsd"
instead of "MySchema" to the MemBufInputSource c-tor.

hth,
-boris


-- 
Free/OpenSource XML Schema to C++ translator - http://codesynthesis.com


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

Reply via email to