21 #ifndef LibXmlDomReader_hxx
22 #define LibXmlDomReader_hxx
30 #include <libxml++/parsers/domparser.h>
41 xmlpp::DomParser * parser;
47 parser =
new xmlpp::DomParser;
52 if (parser)
delete parser;
57 xmlpp::DomParser * temp = parser;
61 xmlpp::Document *
read(std::istream & target)
63 if (target.fail())
throw XmlStorageErr(
"Unable to open the document source");
64 parser->set_validate(
false);
65 parser->set_substitute_entities();
68 parser->parse_stream(target);
70 catch (xmlpp::parse_error & e)
73 std::string(
"\nXML Parser Errors:\n")+e.what()+
"\n");
75 xmlpp::Document *doc = parser->get_document();
76 CLAM_ASSERT(doc,
"No errors but document not loaded!");
84 #endif//LibXmlDomReader_hxx