From b6ea028a9d2ceed5da7aa15e68c56cfd91291e94 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 20 Mar 2014 15:49:53 +0100 Subject: added no-copy --- src/eu/siacs/conversations/xml/Element.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/eu/siacs/conversations/xml/Element.java') diff --git a/src/eu/siacs/conversations/xml/Element.java b/src/eu/siacs/conversations/xml/Element.java index 6cf6d3a5..91d9ed6b 100644 --- a/src/eu/siacs/conversations/xml/Element.java +++ b/src/eu/siacs/conversations/xml/Element.java @@ -17,7 +17,22 @@ public class Element { public Element addChild(Element child) { this.content = null; children.add(child); - return this; + return child; + } + + public Element addChild(String name) { + this.content = null; + Element child = new Element(name); + children.add(child); + return child; + } + + public Element addChild(String name, String xmlns) { + this.content = null; + Element child = new Element(name); + child.setAttribute("xmlns", xmlns); + children.add(child); + return child; } public Element setContent(String content) { -- cgit v1.2.3