Hi Albero,

        I've tried that and got the error as it is in the attachment.
This is my code:

XercesDOMParser * parser = new XercesDOMParser;
Janitor<XercesDOMParser> j_parser(parser);

parser->setDoNamespaces(true);
parser->setCreateEntityReferenceNodes(true);  

if (doCheckSchema)
{

  HINSTANCE insApp   = AfxGetInstanceHandle();
  HRSRC     hResInfo =
FindResource(insApp,(LPCSTR)IDR_SCHEMA_XMLSIG,"SCHEMAS");
  HGLOBAL   hRes     = LoadResource(insApp,hResInfo );

  DWORD dwFileLength = SizeofResource( insApp, hResInfo );

  if (dwFileLength == 0) {
    return 0;
  }

  MemBufInputSource * is = new MemBufInputSource((const unsigned char
*const)hRes, dwFileLength, "XYZ");
  Janitor<MemBufInputSource> j_is(is);  

  parser->loadGrammar(*is, Grammar::SchemaGrammarType, true);

  parser->setDoSchema(true);
  parser->setValidationSchemaFullChecking(true);
  parser->setValidationScheme(XercesDOMParser::Val_Always);
  parser->useCachedGrammarInParse(true);

}

        Btw, do I have to set useCachedGrammarInParse()? I'm validating
with schema only once and never again.

Thank you very much,
Milan
Error at file 
C:\my.xml
line 
1
, column 
67
 Message: 
Unknown element 'note'
Error at file 
C:\my.xml
line 
2
, column 
6
 Message: 
Unknown element 'to'
Error at file 
C:\my.xml
line 
2
, column 
17
 Message: 
Unknown element 'firstname'
Error at file 
C:\my.xml
line 
2
, column 
43
 Message: 
Unknown element 'lastname'
Error at file 
C:\my.xml
line 
3
, column 
8
 Message: 
Unknown element 'from'
Error at file 
C:\my.xml
line 
4
, column 
11
 Message: 
Unknown element 'heading'
Error at file 
C:\my.xml
line 
5
, column 
8
 Message: 
Unknown element 'body'
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to