summaryrefslogtreecommitdiff
path: root/src/core/XML.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/XML.cpp')
-rw-r--r--src/core/XML.cpp14
1 files changed, 11 insertions, 3 deletions
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 << "</" << name << ">";
+ out << "</";
+ if(!nspace.empty()){
+ out << nspace << ":";
+ }
+ out << name << ">";
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<xml::Text>("XMLText").parent(&XMLNode);
}