validation with a grammar

Hi, I have been trying to validate an XML document
with a schema grammar that I pre-parse before parsing
the main document.  My schema grammar parses successfully,
but I've not been able to apply it to the parsing of the
target XML document.  Help!  I am using the XercesDOMParser
APIs as follows:


    XercesDOMParser *parser = new XercesDOMParser;

    parser->setValidationScheme(XercesDOMParser::Val_Always);
    parser->setDoNamespaces(true);
    parser->setDoSchema(true);
    parser->setValidationSchemaFullChecking(true);
    parser->setCreateEntityReferenceNodes(true);
    .
    .
    .
          // Loading grammar from xsd file
          //
          const char*                xsdptr = "grammar.xsd" ;
          const short                grammartype = 1 ;  //DTD or Schema
          parser->cacheGrammarFromParse(true);
          parser->loadGrammar(xsdptr, grammartype, true);
     .
     .
     .          
          parser->useCachedGrammarInParse(true);   //redundant
          parser->parse(XmlFile);


NOTES:
I have used the isUsingCachedGrammarInParse()  
and also the    isCachingGrammarFromParse()  APIs to verify
that the grammar is being parsed and cached.  I just can't get it
to be applied to my XmlFile parse!  Thanks for the help.




----------------------------------------------------------------------
"I am putting myself to the fullest possible use, which is all I can
think that any conscious entity can ever hope to do."

                         -- from 2001, A Space Odyssey.
----------------------------------------------------------------------
| Miguel Siu                                msiu@sdsio.jpl.nasa.gov  |
| RAYTHEON Corporation                                               |
| 299 North Euclid Ave. Suite 500           (626) 817-5923  Raytheon |
| Pasadena, CA  91101                                                |
+--------------------------------------------------------------------+

Received on Friday, 10 January 2003 13:57:27 UTC