Beispiel #1
0
void XMLElement :: DumpOn( std::ostream & os, bool recurse  ) const {
	os << "<" << Name();
	for ( unsigned int i = 0; i < AttrCount(); i++ ) {
		os << " " << AttrName(i) << "=\"";
		os << AttrValue( AttrName(i) ) << "\"";
	}
	if ( ! recurse ) {
		os << "/>\n";
	}
	else {
		os << ">\n";
		for ( unsigned int i = 0; i < ChildCount(); i++ ) {
			const XMLElement * ce = ChildElement( i ) ;
			if ( ce ) {
				ce->DumpOn( os, recurse );
			}
			const XMLText * ct = ChildText( i );
			if ( ct ) {
				os << LTrim( ct->Text() ) << "\n";
			}
		}
		os << "</" << Name() << ">\n";
	}
}
Beispiel #2
0
void ModelBuilder :: BuildEchoer( Model * model, const ALib::XMLElement * e ) {
	AllowAttrs( e, AttrList( 0 ) );
	string text = ChildText( e );
	model->AddEntry( new Echoer( text ) );
}