From 878865b0c53196bc7b21edda423b83b4f14a88d5 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Tue, 17 Feb 2015 15:11:03 +0100 Subject: added namespace handling to XML --- src/core/XML.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/core/XML.cpp') diff --git a/src/core/XML.cpp b/src/core/XML.cpp index 0aedbd9..e25d18a 100644 --- a/src/core/XML.cpp +++ b/src/core/XML.cpp @@ -71,7 +71,11 @@ void Element::doSerialize(std::ostream &out, unsigned int tabdepth, bool pretty) out << '\t'; } } - out << '<' << name; + out << '<'; + if(!nspace.empty()){ + out << nspace << ":"; + } + out << name; for (auto &a : attributes) { out << ' ' << a.first << "=\"" << escapePredefinedEntities(a.second) << '\"'; @@ -95,7 +99,11 @@ void Element::doSerialize(std::ostream &out, unsigned int tabdepth, bool pretty) out << '\t'; } } - out << ""; + out << ""; if (pretty) { out << std::endl; } @@ -125,7 +133,7 @@ namespace RttiTypes .composedOf(&XMLNode) .property("name", {&RttiTypes::String, {[](const xml::Element *obj) { - return Variant::fromString(obj->name); + return Variant::fromString(obj->getName()); }}}); const Rtti XMLText = RttiBuilder("XMLText").parent(&XMLNode); } -- cgit v1.2.3