ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r449309 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/XmlProperty.java
Date Sat, 23 Sep 2006 21:35:40 GMT
Author: peterreilly
Date: Sat Sep 23 14:35:39 2006
New Revision: 449309

URL: http://svn.apache.org/viewvc?view=rev&rev=449309
Log:
Bugzilla 26286: allow empty leaf nodes to be properties

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=449309&r1=449308&r2=449309
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sat Sep 23 14:35:39 2006
@@ -24,6 +24,9 @@
 
 * <junittask/> created junitvmwatcher*.properties files but did not close and delete
them.  
 
+* <xmlproperty> did not create properties for empty leaf elements.
+  Bugzilla report 26286.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java?view=diff&rev=449309&r1=449308&r2=449309
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java Sat Sep 23 14:35:39
2006
@@ -430,6 +430,9 @@
             && (node.getFirstChild().getNodeType() == Node.CDATA_SECTION_NODE)) {
 
             nodeText = node.getFirstChild().getNodeValue();
+        } else if ((node.getNodeType() == Node.ELEMENT_NODE)
+                   && (node.getChildNodes().getLength() == 0)) {
+            nodeText = "";
         }
 
         if (nodeText != null) {
@@ -439,9 +442,7 @@
                 id = (String) container;
             }
 
-            if (nodeText.trim().length() != 0) {
-                addProperty(prefix, nodeText, id);
-            }
+            addProperty(prefix, nodeText, id);
         }
 
         // Return the Path we added or the ID of this node for



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message