Improved no children node case.

This commit is contained in:
Christian P. MOMON 2013-07-03 00:23:01 +02:00
parent cb90963a61
commit b00a7aeb62

View file

@ -312,7 +312,7 @@ public class Presenter
result = ""; // Grrrr, Java ... result = ""; // Grrrr, Java ...
NodeList children = node.getChildNodes(); NodeList children = node.getChildNodes();
if (children == null) if ((children == null) || (children.getLength() == 0))
{ {
result = ""; result = "";
} }
@ -895,7 +895,7 @@ public class Presenter
// Build attributes. // Build attributes.
result.append(processAttributes(attrs, data.attributes(), suffix)); result.append(processAttributes(attrs, data.attributes(), suffix));
if ((node.getChildNodes() == null) && ((data == null) || (data.display() == null))) if (((node.getChildNodes() == null) || (node.getChildNodes().getLength() == 0)) && ((data == null) || (data.display() == null)))
{ {
// Close the tag. // Close the tag.
result.append(" />"); result.append(" />");
@ -940,7 +940,7 @@ public class Presenter
result.append(processAttributes(attrs, data.attributes(), Integer.toString(nLine))); result.append(processAttributes(attrs, data.attributes(), Integer.toString(nLine)));
if ((node.getChildNodes() == null) && ((data == null) || (data.display() == null))) if (((node.getChildNodes() == null) || (node.getChildNodes().getLength() == 0)) && ((data == null) || (data.display() == null)))
{ {
// Close the tag. // Close the tag.
result.append(" />\n"); result.append(" />\n");