Affects Version/s: None
Fix Version/s: v1.10.0
(Imported from Google Code)
Issue #82: Multiple revisions related to XML namespace resolution
- The default DDMSVersion has been bumped up to "3.1". If you were previously building 3.0 components from scratch, but your code did not explicitly call DDMSVersion.setCurrentVersion("3.0"), you may encounter issues. Adding the explicit call to setCurrentVersion should fix it.
- Previously, the DDMSVersion class made some assumptions about XML namespaces. These two methods,
public static DDMSVersion getVersionForGmlNamespace()
public static DDMSVersion getVersionForNamespace()
assumed that there would always be a 1-to-1 relationship between a DDMS version and an XML namespace. With the introduction of DDMS 3.1 (and possible future versions) this is no longer true, so the methods have been removed. Instead, two new methods have been added:
public static boolean isSupportedDDMSNamespace(String xmlNamespace)
public static boolean isCompatibleWithVersion(String ddmsVersion, Element ddmsElement)
So instead of the old rule "Each XML namespaces is associated with 1 DDMS Version", the new rule is "An XML namespace is compatible with 1 or more DDMS Versions".
- The method, getDDMSVersion(), has been removed from the IDDMSComponent interface, because of the rule change described in the previous bullet. As an example, the same instance of a Point or Polygon could work with both DDMS 3.0 and DDMS 3.1, so it no longer makes sense to link a component to a DDMS Version. Instead, the XML namespaces of the components or attributes are used to trace back to a DDMS Version.
- A new method has been added to DDMSVersion:
public static DDMSVersion getVersionForNamespace(String ddmsNamespaceURI)
This method will always return the MOST RECENT DDMSVersion for a given XML namespace. So, if DDMS 3.2 arrives and has the same XML namespace as DDMS 3.1, a lookup will return 3.2. This is mainly for future compatibility, with the understanding that "A new DDMS Version which reuses an existing XML namespace should be completely backwards compatible with other versions that use the same XML namespace, so the new version of schemas should implicitly be able to validate the old instances".