summaryrefslogtreecommitdiff
path: root/src/core/XML.hpp
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-17 15:11:03 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-17 15:11:03 +0100
commit878865b0c53196bc7b21edda423b83b4f14a88d5 (patch)
tree1956a41bd98ad3808a8f1d69b3fb9f646002acbf /src/core/XML.hpp
parent295e0619f135ed6b3c200155beb20ffff03259fc (diff)
added namespace handling to XML
Diffstat (limited to 'src/core/XML.hpp')
-rw-r--r--src/core/XML.hpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/core/XML.hpp b/src/core/XML.hpp
index a1021d3..02b0d89 100644
--- a/src/core/XML.hpp
+++ b/src/core/XML.hpp
@@ -113,22 +113,19 @@ public:
class Element : public Node {
private:
ManagedVector<Node> children;
-
-public:
- const std::string name;
std::map<std::string, std::string> attributes;
+ const std::string nspace;
+ const std::string name;
- Element(Manager &mgr, Handle<Element> parent, std::string name)
- : Node(mgr, parent), children(this), name(std::move(name))
- {
- }
-
+public:
Element(Manager &mgr, Handle<Element> parent, std::string name,
- std::map<std::string, std::string> attributes)
+ std::map<std::string, std::string> attributes = {},
+ std::string nspace = "")
: Node(mgr, parent),
children(this),
- name(std::move(name)),
- attributes(std::move(attributes))
+ attributes(std::move(attributes)),
+ nspace(std::move(nspace)),
+ name(std::move(name))
{
}
@@ -151,10 +148,16 @@ public:
children.insert(children.end(), c.begin(), c.end());
}
+ const std::string &getNamespace() const { return nspace; }
+
+ const std::string &getName() const { return name; }
+
const std::map<std::string, std::string> &getAttributes() const
{
return attributes;
}
+
+ std::map<std::string, std::string> &getAttributes() { return attributes; }
};
class Text : public Node {