[prev in list] [next in list] [prev in thread] [next in thread]
List: xerces-cvs
Subject: svn commit: r1085513 -
From: mrglavas () apache ! org
Date: 2011-03-25 18:50:09
Message-ID: 20110325185009.D784023889FA () eris ! apache ! org
[Download RAW message or body]
Author: mrglavas
Date: Fri Mar 25 18:50:09 2011
New Revision: 1085513
URL: http://svn.apache.org/viewvc?rev=1085513&view=rev
Log:
Fixing JIRA Issue #1501: http://issues.apache.org/jira/browse/XERCESJ-1501. Namespace \
declarations may have been added by namespace fix-up. If the "namespace-declarations" \
parameter has been set to false we need to fetch the AttributeMap again if it \
contained no attributes prior to namespace fix-up.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/DOMNormalizer.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/DOMNormalizer.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/DOMNormalizer.java?rev=1085513&r1=1085512&r2=1085513&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/DOMNormalizer.java \
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/DOMNormalizer.java \
Fri Mar 25 18:50:09 2011 @@ -345,13 +345,21 @@ public class DOMNormalizer implements \
XM // remove default attributes
namespaceFixUp(elem, attributes);
- if ((fConfiguration.features & DOMConfigurationImpl.NSDECL) == 0 \
&& attributes != null ) {
- for (int i = 0; i < attributes.getLength(); ++i) {
- Attr att = (Attr)attributes.getItem(i);
- if (XMLSymbols.PREFIX_XMLNS.equals(att.getPrefix()) ||
- XMLSymbols.PREFIX_XMLNS.equals(att.getName())) {
- elem.removeAttributeNode(att);
- --i;
+ if ((fConfiguration.features & DOMConfigurationImpl.NSDECL) == \
0) { + // Namespace declarations may have been added by \
namespace fix-up. Need + // to fetch the AttributeMap again if \
it contained no attributes prior + // to namespace fix-up.
+ if (attributes == null) {
+ attributes = (elem.hasAttributes()) ? (AttributeMap) \
elem.getAttributes() : null; + }
+ if (attributes != null) {
+ for (int i = 0; i < attributes.getLength(); ++i) {
+ Attr att = (Attr)attributes.getItem(i);
+ if (XMLSymbols.PREFIX_XMLNS.equals(att.getPrefix()) \
|| + \
XMLSymbols.PREFIX_XMLNS.equals(att.getName())) { + \
elem.removeAttributeNode(att); + --i;
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic