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 Boris Kolpackov <bo...@codesynthesis.com> on 2009/04/23 12:15:08 UTC

Fix for the multiple import option

Hi David,

I just committed[1] a fix for a problem in the multiple import option
added in 3.0.0. I believe you were the author of that feature so it
would be good if you could review my changes and let me know if you
see any potential problems with the fix.

The problem is as follows: When a second schema is imported with the
same namespace (and fgXercesHandleMultipleImports is true) the
fScopeCount counter in TraverseSchema.cpp is reset back to 0 but the
declarations are added to the same SchemaGrammar as was created for
the first schema. This results in duplicate scope numbers used for
unrelated declarations.

The original code used SchemaInfo objects to save the scope count.
While this works for the case where all subsequent imports for the
namespaces are ignored, it doesn't work for the multiple import
case since each imported file ends up with its own SchemaInfo
object. To fix this I moved the scope counter from SchemaInfo to
SchemaGrammar object.

[1] http://svn.apache.org/viewvc?view=rev&revision=767875

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org