You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2014/04/09 00:16:37 UTC

[39/50] [abbrv] git commit: fix serialization for empty elements

fix serialization for empty elements


Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/3f4797bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/3f4797bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/3f4797bb

Branch: refs/heads/master
Commit: 3f4797bb7b17916947c6d0a9e821eb5084e23f5f
Parents: e553544
Author: Till Westmann <we...@gmail.com>
Authored: Thu Apr 3 10:25:13 2014 -0700
Committer: Preston Carman <pr...@apache.org>
Committed: Sun Apr 6 09:50:42 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/vxquery/serializer/XMLSerializer.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/3f4797bb/vxquery-core/src/main/java/org/apache/vxquery/serializer/XMLSerializer.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/serializer/XMLSerializer.java b/vxquery-core/src/main/java/org/apache/vxquery/serializer/XMLSerializer.java
index 51670e8..189ae24 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/serializer/XMLSerializer.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/serializer/XMLSerializer.java
@@ -369,14 +369,16 @@ public class XMLSerializer implements IPrinter {
                 printSequence(ps, seqp);
             }
 
-            ps.append('>');
             enp.getChildrenSequence(ntp, seqp);
             if (seqp.getByteArray() != null) {
+                ps.append('>');
                 printSequence(ps, seqp);
+                ps.append("</");
+                printPrefixedQName(ps, cqp, utf8sp);
+                ps.append('>');
+            } else {
+                ps.append("/>");
             }
-            ps.append("</");
-            printPrefixedQName(ps, cqp, utf8sp);
-            ps.append('>');
         } finally {
             pp.giveBack(seqp);
             pp.giveBack(utf8sp);