Sven Bauhan wrote:
Check the "Associating Schema Grammar with instance document" section on
this page:
http://xerces.apache.org/xerces-c/schema.html
I have already implemented this. My xml documents have this header:
...
There it says:
Xerces-C++ 2.8.0 provides a new function to pre-parse the grammar ...
Unfortunately I just have Xerces-C++ 2.7.0 available. Is there also a way to
define the location of the schema in the source code?
All you need to do is implement a DOMEntityResolver and give it to the parser.
When parsing the xml file I get warning, that the elements (like AtcissData)
are undefined. How can I find out, why it is impossible to load the schema?
I put the schema file in the working directory and thought the parser would
find it there. I do not know, if it is my schema file or the XMLSchema
definition which cannot be found.
The parser uses the base URI of the XML document to resolve the relative
URI in the schemaLocation attribute. Unless the XML document is in the
working directory, it won't work.
You can solve your problem by implementing a DOMEntityResolver. The
Redirect sample application show how you can implement an EntityResolver,
which is the equivalent for a SAX parser.
Dave