57 xml_nodeRef new_ref(new_el);
65 return GetPointer<xml_element>(node);
75 xml_nodeRef new_ref(new_el);
83 xml_nodeRef new_ref(new_el);
91 xml_nodeRef new_ref(new_el);
109 std::vector<std::string> splitted =
SplitString(path,
"/");
113 const auto* child_xml = GetPointer<const xml_element>(child);
118 iteration_input_nodes.insert(child);
122 const auto current_level_tag = splitted[
level];
123 for(
const auto& iteration_input_node : iteration_input_nodes)
125 if(iteration_input_node->get_name() == current_level_tag)
127 if(
level == splitted.size() - 1)
129 ret.insert(iteration_input_node);
133 for(
const auto& child : GetPointer<xml_child>(iteration_input_node)->
get_children())
135 const auto* child_xml = GetPointer<const xml_element>(child);
140 iteration_output_nodes.insert(child);
145 iteration_input_nodes = iteration_output_nodes;
const std::vector< std::string > SplitString(const std::string &input, const std::string &separators)
Function which splits a string into tokens.
const CustomSet< xml_nodeRef > CGetDescendants(const std::string &path) const
Return the set of descendants with a specific path.
xml_text_node * add_child_text(const std::string &content)
Append a new text node.
int line
The line number in the XML file (not unsigned because lineno function of the lexer returns an int) ...
Auxiliary methods for manipulating string.
xml_att_decl_node * add_child_attribute_declaration(const std::string &name)
Append a new attribute declaration node.
xml_text_node * first_text
int get_line() const
Discover at what line number this node occurs in the XML file.
xml_comment_node * add_child_comment(const std::string &content)
Append a new comment node.
void set_line(int _line)
Set the line this node occurs in the XML file.
node_list const & get_children()
Obtain the list of child nodes.
xml_element * add_child_element(const std::string &name)
Add a child element to this node.