Revision: 523
Author:
joe.b...@gmail.com
Date: Tue Dec 9 20:45:18 2014 UTC
Log: (Issue 158) Prevented duplicate parsing of chameleon schema by
adding the starting point schema to the list of seen chameleons if it has
no targetNamespace. That way, if that schema is included into the
no-namespace namespace later, it won't be re-parsed and won't create
duplicate component definitions.
https://code.google.com/p/genxdm/source/detail?r=523
Modified:
/trunk/project/processor.w3c.xs/src/main/java/org/genxdm/processor/w3c/xs/impl/XMLSchemaParser.java
=======================================
---
/trunk/project/processor.w3c.xs/src/main/java/org/genxdm/processor/w3c/xs/impl/XMLSchemaParser.java
Tue Sep 9 19:15:24 2014 UTC
+++
/trunk/project/processor.w3c.xs/src/main/java/org/genxdm/processor/w3c/xs/impl/XMLSchemaParser.java
Tue Dec 9 20:45:18 2014 UTC
@@ -167,7 +167,23 @@
}
else
{
- cache.m_seenSystemIds.add(systemId);
+ // If this schema doesn't have a targetNamespace, add it the
chameleon list so we don't reparse it
+ // into the no namespace.
+
if(XMLConstants.NULL_NS_URI.equals(module.computeTargetNamespace()))
+ {
+ HashSet<String> tnsSet =
cache.m_seenChameleonsLocation2Tns.get(systemId);
+ if(tnsSet != null)
+ {
+ tnsSet.add(XMLConstants.NULL_NS_URI);
+ }
+ else
+ {
+ final HashSet<String> newList = new HashSet<String>();
+ newList.add(XMLConstants.NULL_NS_URI);
+ cache.m_seenChameleonsLocation2Tns.put(systemId, newList);
+ }
+ }
+ cache.m_seenSystemIds.add(systemId);
}
}
else