typedef boost::shared_ptr<cxml::Node> NodePtr;
typedef std::list<NodePtr> NodeList;
typedef boost::shared_ptr<const cxml::Node> ConstNodePtr;
+typedef std::list<std::pair<std::string, std::string> > KeyValueList;
class Node
{
NodeList children () const;
NodeList children (std::string) const;
+
/** Add a child node with a given name */
NodePtr add_child (std::string name, std::string namespace_prefix = "")
{
_children.push_back (n);
return n;
}
-
+
+ void set_namespace_declaration (std::string uri, std::string prefix = "");
+
+ KeyValueList namespace_declarations () const {
+ return _namespace_declarations;
+ }
+
void set_content (std::string c) {
_content = c;
}
/** @return The content of this node */
std::string content () const;
+
void set_attribute (std::string name, std::string value);
+
void set_namespace_prefix (std::string p) {
_namespace_prefix = p;
}
+
/** @return namespace prefix of this node */
std::string namespace_prefix () const;
/** This will mark a child as to be ignored when calling done() */
std::string _name;
std::string _content;
std::string _namespace_prefix;
- std::list<std::pair<std::string, std::string> > _attributes;
+ KeyValueList _attributes;
+ KeyValueList _namespace_declarations;
mutable std::list<std::string> _taken;
};