Ejemplo n.º 1
0
//-----------------------------------------------------------------------------------------
void process_messages(const XmlElement& xf, const Components& components, const string& tag, const int depth, ostream& outf)
{
	outf << string((depth + 1) * 2, ' ') << '<' << tag;
	output_attributes(xf, outf);
	outf << '>' << endl;

	for(XmlElement::XmlSet::const_iterator mitr(xf.begin()); mitr != xf.end(); ++mitr)
		process_elements(mitr, components, depth + 2, outf);
	outf << string((depth + 1) * 2, ' ') << "</" << tag << '>' << endl;
}
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------------------
void process_group(const XmlElement& xf, const Components& components, const int depth,
	ostream& outf, const string& compon, bool required)
{
	outf << string(depth * 2, ' ') << "<group";
	output_attributes(xf, outf, required);
	if (!compon.empty())
		outf << " component=\'" << compon << '\'';
	outf << '>' << endl;

	for(XmlElement::XmlSet::const_iterator itr(xf.begin()); itr != xf.end(); ++itr)
		process_elements(itr, components, depth + 1, outf, string(), required);
	outf << string(depth * 2, ' ') << "</group>" << endl;
}