Boris, Thanks for the sample code. It clarifies that there seems to be only one way to do this, and I was doing basically what you do. So this is useful feedback, the two small issues below notwithstanding:
I can't figure out two things in your code: >> parser->setFeature (XMLUni::fgDOMNamespaces, true); << I only see a feature called fgSAX2CoreNameSpaces for the SAX2XMLReader interface, what interface are you using? Or what interface does this feature belong do? >> parser->release(); << There is no 'release()' in the SAX2XMLReader interface, what interface is this? Thanks, Elisha > -----Original Message----- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Boris Kolpackov > Sent: Thursday, May 26, 2005 9:39 AM > To: [email protected] > Subject: Re: Validating XSD(s) > > "Elisha Berns" <[EMAIL PROTECTED]> writes: > > > But my question is, once again, assuming that you are only using Xerces, > > what is the best and most thorough way to validate an XSD? > > Alright, seeing that you are asking this 10th time I will take a shot. > In my code I do basically the following: > > > // Perform namespace processing. > // > parser->setFeature (XMLUni::fgDOMNamespaces, true); > > > // Enable the parser's schema support. > // > parser->setFeature (XMLUni::fgXercesSchema, true); > > > // Enable full schema constraint checking, including checking which > // may be time-consuming or memory intensive. Currently, particle > // unique attribution constraint checking and particle derivation > // restriction checking are controlled by this option. > // > parser->setFeature (XMLUni::fgXercesSchemaFullChecking, true); > > // The parser will treat validation error as fatal and will exit. > // > parser->setFeature (XMLUni::fgXercesValidationErrorAsFatal, true); > > > ErrorHandler eh; > parser->setErrorHandler(&eh); > > > parser->loadGrammar (uri, Grammar::SchemaGrammarType); > > > parser->release(); > > > > It works pretty well for me so far. I.e., every time I mess up > my schemas the above code catches it. > > hth, > -boris > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
