You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Alberto Massari <am...@progress.com> on 2004/09/15 15:34:31 UTC
Re: No response - (XERCESC-1263) Abstract type not handled
correctly by cached grammar
Hi Matthew,
have you tried to set the validation to "always"? The default value
("auto") will activate schema validation only if the root element has the
xsi:noNamespaceSchemaLocation attribute.
Alberto
At 10.21 15/09/2004 +0100, Matthew Berry wrote:
>Hi Xerces-team,
>
>I posted a problem I was observing in August and as yet have not heard any
>response.
>
>Can someone confirm that this is in fact a problem with Xerces? When can I
>expect it to be fixed?
>
>Many thanks
>Matthew
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: No response - (XERCESC-1263) Abstract type not handled
correctly by cached grammar
Posted by Alberto Massari <am...@progress.com>.
At 18.01 15/09/2004 +0100, Matthew Berry wrote:
>Alberto,
>
>As you guessed this has worked and my document is now validated correctly.
>
>Is the behaviour I was observing a bug in Xerces or is the step you
>described the correct way to set up the parser? If it is a bug it would be
>good to have a patch file as soon as is convenient.
I would call it a bug; what I suggested you can be seen as a workaround, or
as a performance improvement (the default scanner, IGXMLScanner, is slower
because it has to adapt to use either schemas or DTDs; SGXMLScanner and
DGXMLScanner are the versions that only know about either XMLSchema or DTD;
WFGXMLScanner doesn't perform validation at all, and it's the fastest).
Not to forget about this discovery, can you add a comment on Jira about the
fact that it works if you use the SGXMLScanner?
Thanks,
Alberto
>Thanks for all your help.
>Matthew
>
>
> > 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?
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: No response - (XERCESC-1263) Abstract type not handled correctly by cached grammar
Posted by Matthew Berry <ma...@apt.com>.
Alberto,
As you guessed this has worked and my document is now validated correctly.
Is the behaviour I was observing a bug in Xerces or is the step you
described the correct way to set up the parser? If it is a bug it would be
good to have a patch file as soon as is convenient.
Thanks for all your help.
Matthew
> 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?
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: No response - (XERCESC-1263) Abstract type not handled
correctly by cached grammar
Posted by Alberto Massari <am...@progress.com>.
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: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: No response - (XERCESC-1263) Abstract type not handled correctly by cached grammar
Posted by Matthew Berry <ma...@apt.com>.
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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: No response - (XERCESC-1263) Abstract type not handled correctly by cached grammar
Posted by Matthew Berry <ma...@apt.com>.
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
> Hi Matthew,
> have you tried to set the validation to "always"? The default value
> ("auto") will activate schema validation only if the root element has the
> xsi:noNamespaceSchemaLocation attribute.
>
> Alberto
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org