Esempio n. 1
0
xmlDocPtr XMLParser::getXmlDocFromFile(boost::filesystem::path rootFile) throw (::fwTools::Failed)
{
    xmlDocPtr xmlDoc = NULL;
    xmlNodePtr xmlRoot = NULL;

#if BOOST_FILESYSTEM_VERSION > 2
    xmlDoc = xmlParseFile ( rootFile.string().c_str () );
#else
    xmlDoc = xmlParseFile ( rootFile.c_str () );
#endif
    if (xmlDoc == NULL)
    {
        throw ::fwTools::Failed("Unable to parse the XML file " + rootFile.string() );
    }

    SLM_DEBUG( "Managing XInclude" );
    xmlRoot = xmlDocGetRootElement (xmlDoc);
    if (xmlXIncludeProcessTree (xmlRoot) == -1)
    {
        throw ::fwTools::Failed(std::string ("Unable to manage xinclude !"));
    }

    // memory cleanup

    return xmlDoc;
}
Esempio n. 2
0
 void process(node_ptr<element<S> > e) { xmlXIncludeProcessTree(impl(*e));}