You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2014/04/05 21:46:37 UTC
svn commit: r1585186 -
/commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/XMLConfiguration.java
Author: oheger
Date: Sat Apr 5 19:46:36 2014
New Revision: 1585186
URL: http://svn.apache.org/r1585186
Log:
Fixed a problem with handling of the xml:space attribute.
Modified:
commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/XMLConfiguration.java
Modified: commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/XMLConfiguration.java?rev=1585186&r1=1585185&r2=1585186&view=diff
==============================================================================
--- commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/XMLConfiguration.java (original)
+++ commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/XMLConfiguration.java Sat Apr 5 19:46:36 2014
@@ -197,6 +197,9 @@ public class XMLConfiguration extends Ba
/** Constant for the name of the space attribute.*/
private static final String ATTR_SPACE = "xml:space";
+ /** Constant for an internally used space attribute. */
+ private static final String ATTR_SPACE_INTERNAL = "config-xml:space";
+
/** Constant for the xml:space value for preserving whitespace.*/
private static final String VALUE_PRESERVE = "preserve";
@@ -591,7 +594,7 @@ public class XMLConfiguration extends Ba
{
boolean trimFlag = shouldTrim(element, trim);
Map<String, String> attributes = processAttributes(element);
- attributes.put(ATTR_SPACE, String.valueOf(trimFlag));
+ attributes.put(ATTR_SPACE_INTERNAL, String.valueOf(trimFlag));
StringBuilder buffer = new StringBuilder();
NodeList list = element.getChildNodes();
boolean hasChildren = false;
@@ -609,7 +612,7 @@ public class XMLConfiguration extends Ba
Map<String, String> attrmap =
constructHierarchy(childNode, refChildValue, child,
elemRefs, trimFlag, level + 1);
- Boolean childTrim = Boolean.valueOf(attrmap.remove(ATTR_SPACE));
+ Boolean childTrim = Boolean.valueOf(attrmap.remove(ATTR_SPACE_INTERNAL));
childNode.addAttributes(attrmap);
ImmutableNode newChild =
createChildNodeWithValue(node, childNode,