Example #1
0
void Bank::createFromXml( istringstream& is, Program& program )
{
    Document doc;
    try
    {
	    doc.Parse( is.str(), true );
        Node* root = &doc;

        Node* programNode = doc.FirstChild( "Program", false );
        if( programNode != NULL ) {
            root = programNode;
        }

	    Iterator< Element > it( "Module" );
	    for( it = it.begin( root ); it != it.end(); it++ )
	    {
		    ModuleData* data = new ModuleData();
		    Element* moduleElement = it.Get();
		    readModule( moduleElement, data );

		    program.addModule( data );
	    }
    }
    catch( const exception& e ) {
        TRACE( e.what() );
    }
}