From b00a7aeb62c47c4d1d007326b84c9773da47a8ab Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 3 Jul 2013 00:23:01 +0200 Subject: [PATCH] Improved no children node case. --- src/fr/devinsy/xidyn/Presenter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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");