1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
14 #include <anna/core/tracing/Logger.hpp>
15 #include <anna/core/tracing/TraceMethod.hpp>
16 #include <anna/config/defines.hpp>
18 #include <libxml/parser.h>
20 #include <anna/xml/DTDFile.hpp>
24 using namespace anna::xml;
26 _xmlDtd* DTDFile::parse(const char *filename) const
27 throw(RuntimeException) {
28 LOGMETHOD(TraceMethod tf("anna::xml::DTDFile", "parse", ANNA_FILE_LOCATION));
31 LOGDEBUG(Logger::write(Logger::Debug, "Analyzing DTD file", filename, ANNA_FILE_LOCATION));
33 if((stream = open(filename, O_RDONLY)) == -1)
34 throw RuntimeException(string(filename), errno, ANNA_FILE_LOCATION);
38 if((result = xmlParseDTD(NULL, BAD_CAST(filename))) == NULL)
39 throw RuntimeException("DTD is wrong", ANNA_FILE_LOCATION);