Repository: incubator-vxquery Updated Branches: refs/heads/westmann/serialization [created] 71c71087d
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/71c71087 Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/71c71087 Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/71c71087 Branch: refs/heads/westmann/serialization Commit: 71c71087db747af7195decfe2523a803f3f7ec95 Parents: a09d1f5 Author: Till Westmann <[email protected]> Authored: Thu Apr 3 10:25:13 2014 -0700 Committer: Till Westmann <[email protected]> Committed: Thu Apr 3 10:25:13 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/71c71087/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);
