Hi,
What does your DTD look like?
Are you sure it is correct? Sometimes the problem is easier to solve then
expected...
Just to start with....
//daniel
Kai Lienemann (2004-05-28 09:58):
>I psoted this question some weeks ago and got no answer. But I think it
>can't be so difficult, although I find no solution. Maybe somebody had the
>same problem?
>So here is the question:
>
>Hello,
>
>I want to validate my XML-Files against a specific DTD-File. Because every
>File shoul be validated with the same DTD-File I tell the parser the
>location of the DTD with the loadGrammar function. It seems he found the DTD
>but by parsing the XML-File every Element and Attribute throws an error.
>
>Can somebody help me or give me a hint???
>
>Here is the part of the programm, where the parser is build:
>
>xercesc::XercesDOMParser::ValSchemes valScheme =
>xercesc::XercesDOMParser::Val_Always;
>
>xercesc::XercesDOMParser *parser = new xercesc::XercesDOMParser;
>parser->setValidationScheme(valScheme);
>parser->setDoNamespaces(false);
>parser->setDoSchema(false);
>parser->setValidationSchemaFullChecking(true);
>
>
>file://set an ErrorHandler
>DOMTreeErrorReporter *errReporter = new DOMTreeErrorReporter();
>parser->setErrorHandler(errReporter);
>
>
>const char* xmlFile = filename.c_str();
>
>try
>{
>// Load grammar and cache it
>parser->resetCachedGrammarPool();
>
>parser->loadGrammar("/amd/callisto/users/wbsstud01/klienema/personal.dtd",
>xercesc::Grammar::DTDGrammarType, false);
>
>// enable grammar reuse
>parser->useCachedGrammarInParse(true);
>parser->cacheGrammarFromParse(true);
>
>file://parse the file and report the errors
>parser->parse(xmlFile);
>int errorCount = parser->getErrorCount();
>cerr << errorCount << " errors" << endl;
>cerr << "success" << endl;
>}
>
>
>
>
>here is some part of the outputed errors:
>
>Error at file "/amd/callisto/users/wbsstud01/klienema/fuenflochleiste.xml",
>line 144, column 47
>Message: Attribute 'deg' is not declared for element 'Axis'
>Error at file "/amd/callisto/users/wbsstud01/klienema/fuenflochleiste.xml",
>line 144, column 66
>Message: Attribute 'abs_deg' is not declared for element 'Axis'
>Error at file "/amd/callisto/users/wbsstud01/klienema/fuenflochleiste.xml",
>line 144, column 80
>Message: Attribute 'rel_deg' is not declared for element 'Axis'
>Error at file "/amd/callisto/users/wbsstud01/klienema/fuenflochleiste.xml",
>line 150, column 24
>Message: Unknown element 'VerbalDescriptions'
>Error at file "/amd/callisto/users/wbsstud01/klienema/fuenflochleiste.xml",
>line 151, column 22
>
>
>Thx
>
>Kai Lienemann
>
>----
>Artificial Intelligence Group
>Faculty of Technology
>University of Bielefeld
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
__________________________________________________________
RFV Data/Produktenheten E-post: [EMAIL PROTECTED]
Daniel Gr�ndal Tfn: 060-187126
S:a J�rnv�gsgatan 41 Mobil: 070-3016517
851 93 Sundsvall Fax: 060-147870
__________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]