5 #include <libxml++/libxml++.h> 15 parser_ =
new xmlpp::DomParser();
25 if (parser_ != NULL) {
28 parser_ =
new xmlpp::DomParser();
32 parser_->parse_memory(xml_input_snippet);
36 }
catch (
const std::exception& ex) {
42 Init(xml_input_snippet.str());
54 xmlpp::Document*
doc = parser_->get_document();
56 doc->process_xinclude();
60 xmlpp::Element* root = doc->get_root_node();
61 xmlpp::NodeSet have_base = root->find(
"//*[@xml:base]");
62 xmlpp::NodeSet::iterator it = have_base.begin();
63 for (; it != have_base.end(); ++it) {
64 reinterpret_cast<xmlpp::Element*
>(*it)->remove_attribute(
"base",
"xml");
void parse_memory(const Glib::ustring &contents)
parse a relaxng schema xml file
For validating files received via IO.
bool Validate(const xmlpp::Document *doc)
validate an xml file agaisnt the given schema
debugging information - most verbose
virtual ~XMLParser()
destructor
Code providing rudimentary logging capability for the Cyclus core.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
void Init(const std::stringstream &input)
initializes a parser with an xml snippet
void Validate(const std::stringstream &schema)
validates the file agaisnt a schema
xmlpp::Document * Document()