summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/XML/XMLElement.cpp')
-rw-r--r--Swiften/Serializer/XML/XMLElement.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Swiften/Serializer/XML/XMLElement.cpp b/Swiften/Serializer/XML/XMLElement.cpp
index d88ff08..289ce31 100644
--- a/Swiften/Serializer/XML/XMLElement.cpp
+++ b/Swiften/Serializer/XML/XMLElement.cpp
@@ -7,14 +7,17 @@
#include "Swiften/Serializer/XML/XMLElement.h"
#include "Swiften/Base/foreach.h"
+#include "Swiften/Serializer/XML/XMLTextNode.h"
namespace Swift {
-XMLElement::XMLElement(const String& tag, const String& xmlns) :
- tag_(tag) {
+XMLElement::XMLElement(const String& tag, const String& xmlns, const String& text) : tag_(tag) {
if (!xmlns.isEmpty()) {
setAttribute("xmlns", xmlns);
}
+ if (!text.isEmpty()) {
+ addNode(XMLTextNode::ref(new XMLTextNode(text)));
+ }
}
String XMLElement::serialize() {