SWS-521 - UnsupportedOperationException During Validation After Upgrade From 1.5.6 to 1.5.7

This commit is contained in:
Arjen Poutsma
2009-07-31 09:02:02 +00:00
parent 1a20f5b765
commit 4a1762b679

View File

@@ -102,6 +102,13 @@ public class SimpleNamespaceContext implements NamespaceContext {
Assert.notNull(namespaceUri, "No namespaceUri given");
if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
defaultNamespaceUri = namespaceUri;
} else if (XMLConstants.XML_NS_PREFIX.equals(prefix)) {
Assert.isTrue(XMLConstants.XML_NS_URI.equals(namespaceUri), "Prefix \"" + prefix +
"\" bound to namespace \"" + namespaceUri + "\" (should be \"" + XMLConstants.XML_NS_URI + "\")");
} else if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) {
Assert.isTrue(XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceUri), "Prefix \"" + prefix +
"\" bound to namespace \"" + namespaceUri + "\" (should be \"" +
XMLConstants.XMLNS_ATTRIBUTE_NS_URI + "\")");
}
else {
prefixToNamespaceUri.put(prefix, namespaceUri);
@@ -112,6 +119,7 @@ public class SimpleNamespaceContext implements NamespaceContext {
/** Removes all declared prefixes. */
public void clear() {
prefixToNamespaceUri.clear();
namespaceUriToPrefixes.clear();
}
/**