/**
 * File: test.cpp
 * Created by: <Joern Reimerdes>
 * Created on: 2004/09/08 20:00:00
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Context Library
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <iwear/debugstream.h>
#include <iwear/utility.h>
#include <iwear_utils_xml/xmlhandler.h>

using namespace std;
using namespace iwear;
using namespace iwear::xml;

int main ( void ){
    try	{
	d_err.set_debuglevel(nonsens);
	d_inf << ANSI_BLUE << "Testing the XMLHandler" << ANSI_NORMAL << endl;
	
	XMLHandler* xmlhandler = new XMLHandler();
	DOMDocument* document = 
	    xmlhandler->load_dom_document_from_file("xml/context.xml", true);
	if (document == NULL){
	    d_warn << "The Document is NULL. " << endl;
	    return 1;
	}

	d_inf << "DocType: " << XMLString::transcode(document->getDoctype()->getNodeName()) << endl;
	//	d_inf << document->getDocumentElement()->getTagName() << endl;

	d_inf << ANSI_YELLOW << "Testing Done" << ANSI_NORMAL << endl;
    }
    catch( const exception& e ) {
	d_err << ANSI_RED << "Exception " << endl;
	d_err << e.what() << ANSI_NORMAL << endl;
    }
}

