Browse Source

Bugzilla 26286: allow empty leaf nodes to be properties

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@449309 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 19 years ago
parent
commit
ffc467b126
2 changed files with 7 additions and 3 deletions
  1. +3
    -0
      WHATSNEW
  2. +4
    -3
      src/main/org/apache/tools/ant/taskdefs/XmlProperty.java

+ 3
- 0
WHATSNEW View File

@@ -24,6 +24,9 @@ Fixed bugs:

* <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:
--------------



+ 4
- 3
src/main/org/apache/tools/ant/taskdefs/XmlProperty.java View File

@@ -430,6 +430,9 @@ public class XmlProperty extends org.apache.tools.ant.Task {
&& (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 @@ public class XmlProperty extends org.apache.tools.ant.Task {
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


Loading…
Cancel
Save