[ https://issues.apache.org/jira/browse/XERCESC-1798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Boris Kolpackov updated XERCESC-1798: ------------------------------------- Attachment: test.xsd test.xml test.cpp The test case. > Orphan/adopt grammar support in XMLGrammarPoolImpl is broken > ------------------------------------------------------------ > > Key: XERCESC-1798 > URL: https://issues.apache.org/jira/browse/XERCESC-1798 > Project: Xerces-C++ > Issue Type: Bug > Components: Validating Parser (XML Schema) > Affects Versions: 2.8.0, 3.0.0 > Reporter: Boris Kolpackov > Attachments: test.cpp, test.xml, test.xsd > > > The attached test case demonstrates a bug in the > orphanGrammar()/cacheGrammar() implementation. In a nutshell, the problem is > in the current architecture that uses XMLStringPool to store namespace URIs > (and in some cases names). This string pool resides in the XMLGrammarPoolImpl > instance and is shared by all individual grammars this grammar pool contains. > When the grammar is orphaned, it does not contain any references to the pool > which used to host it but it still contains string IDs that refer to the > strings inside the string pool. Once such a grammar is imported with > cacheGrammar() into a new grammar pool, there is no way for the importing > grammar pool to populate its string pool with necessary strings. > Properly fixing this bug is not going to be easy. A fairly simple but ugly > workaround is to manually synchronize string pools in the two grammar pools > before importing the grammars (the workaround is commented out in the test > case). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]