8 for (
const auto & attr : attrs) {
15 std::pair<std::string, std::string> attr(attr_name, value);
21 std::string value_str =
toString(value);
22 std::pair<std::string, std::string> attr(attr_name, value_str.data());
28 std::string value_str =
toString(value);
29 std::pair<std::string, std::string> attr(attr_name, value_str);
55 bool vsl_basic_xml_element::delete_attribute(std::string )
57 std::cerr <<
"vsl_basic_xml_element::delete_attribute() not yet implemented\n";
78 for (
auto & attr :
attrs_) {
79 ostr <<
' ' << attr.first <<
"=\"" << attr.second <<
'"';
87 ostr <<
"</" <<
tag_ <<
">\n";
void add_attribute(std::string attr_name, std::string value)
overloaded methods to add attribute values.
std::vector< std::pair< std::string, std::string > > attrs_
the node attributes
void x_write_open(std::ostream &ostr)
writes the opening tag for this node to the stream.
void append_cdata(const std::string &cdata)
std::string tag_
the node name
creates basic xml nodes and writes them out to the stream A basic node contains only text content,...
void x_write(std::ostream &ostr)
std::string cdata_
the text() content of this node
void x_write_close(std::ostream &ostr)
writes the closing tag for this node to the stream.
void add_attribute_list(std::vector< std::pair< std::string, std::string > > attrs)
std::string toString(const T &t)