Hi Matthew, just to test if this is the cause of the problem, try adding a call to
setProperty(XMLUni::fgXercesScannerName, XMLUni::fgSGXMLScanner)
This should force the usage of the scanner that only known about XMLSchema, and ignores any DTD.
Alberto
At 17.33 15/09/2004 +0100, Matthew Berry wrote:
Alberto (and team)
Note: The problem I am having only occurs if the document node is an abstract type. It passes validation if the abstract type is embedded within another element.
I have tried to debug the problem further by delving in the Xerces source.
It would appear that although I have set 'fgXercesSchema', for the document element IGXMLScanner::fValidator is of type DTDValidator. When we then process a child element, its is of type SchemaValidator. (I'm observing a break point in IGXMLScanner::scanRawAttrListforNameSpaces)
DTDValidataor::handlesSchema returns false, and this has the effect that this line (IGXMLScanner2.cpp:1264):
if (fValidator && fValidator->handlesSchema())
evaluates to false and the XsiType is not copied into the SchemaValidator which would then be picked up later.
Does this make sense? Can you comment further?
> Thanks for your reply, Alberto. > > Please note I am using the DOM Level 3 DOMBuilder class, which does not have > setValidationScheme() method. According to the DOMCount sample this should > correspond to the XMLUni::fgDOMValidation feature - which I am setting to > true. > > To clarify I am setting these features in the following order: > > parser->setFeature(XMLUni::fgDOMNamespaces, true); > parser->setFeature(XMLUni::fgDOMValidation, true); > > parser->setFeature(XMLUni::fgXercesSchema, true); > parser->setFeature(XMLUni::fgXercesSchemaFullChecking, true); > parser->setFeature(XMLUni::fgXercesValidationErrorAsFatal, true); > > // parser->loadGrammar( Wrapper4InputSource(&XsdInputSrc, false), > > parser->setFeature(XMLUni::fgXercesUseCachedGrammarInParse, true);
> I also tried changing the order of 'fgDOMValidation', but that didn't seem >to affect things
--------------------------------------------------------------------- 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]