diff --git a/src/fr/devinsy/xidyn/Presenter.java b/src/fr/devinsy/xidyn/Presenter.java index 9083dd2..3d799d2 100644 --- a/src/fr/devinsy/xidyn/Presenter.java +++ b/src/fr/devinsy/xidyn/Presenter.java @@ -312,7 +312,7 @@ public class Presenter result = ""; // Grrrr, Java ... NodeList children = node.getChildNodes(); - if (children == null) + if ((children == null) || (children.getLength() == 0)) { result = ""; } @@ -895,7 +895,7 @@ public class Presenter // Build attributes. 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. result.append(" />"); @@ -940,7 +940,7 @@ public class Presenter 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. result.append(" />\n");