47 if(attribute.first.empty())
49 out <<
' ' << attribute.first
69 for(const auto &element : elements)
70 element.output(out, indent+2);
72 do_indent(out, indent);
75 out << '<
' << '/
' << name << '>
' << "\n";
79 void xmlt::escape(const std::string &s, std::ostream &out)
81 for(const auto ch : s)
105 // � isn't allowed, but what shall we
do?
106 if((ch>=0 && ch<
' ') || ch==127)
118 for(
const auto ch : s)
140 if((ch>=0 && ch<
' ') || ch==127)
150 out << std::string(indent,
' ');
153 xmlt::elementst::const_iterator
xmlt::find(
const std::string &key)
const
155 for(elementst::const_iterator it=
elements.begin();
166 for(elementst::iterator it=
elements.begin();
176 const std::string &attribute,
183 const std::string &attribute,
190 const std::string &attribute,
191 unsigned long long value)
197 const std::string &attribute,
198 const std::string &value)
200 if((value[0]==
'\"' && value[value.size()-1]==
'\"') ||
201 (value[0]==
'\'' && value[value.size()-1]==
'\''))
203 attributes[attribute]=value.substr(1, value.size()-2);
216 std::string result(
"");
218 result.reserve(str.size());
220 for(std::string::const_iterator it=str.begin();
229 while(it!=str.end() && *it!=
';')
238 else if(tmp[0]==
'#' && tmp[1]!=
'x')