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 //
9 #ifndef anna_xml_DocumentFile_hpp
10 #define anna_xml_DocumentFile_hpp
12 #include <anna/config/defines.hpp>
13 #include <anna/xml/Document.hpp>
14 #include <anna/xml/Compiler.hpp>
21 Clase para gestionar un documento XML contenido en un archivo.
23 class DocumentFile : public Document {
28 DocumentFile() : a_filename("<none>"), a_rootNode(NULL) {;}
31 * Root node after parsing, or NULL if not analyzed by mean parse()
33 * @return XML document root node
35 const Node * getRootNode() const throw() { return a_rootNode; }
38 Devuelve el contenido asociado al documento XML.
39 \return El contenido asociado al documento XML.
41 const anna::DataBlock& getContent() const throw(RuntimeException);
44 * Parse xml document and return root node
46 * \warning Need previous initialization
48 const Node* parse() throw(RuntimeException) { return (a_rootNode = Document::parse()); }
51 * Parse xml document with dtd and return root node
52 * \param dtd Validation DTD for XML document
54 * \warning Need previous initialization
56 const Node* parse(const DTD& dtd) throw(RuntimeException) { return (a_rootNode = Document::parse(dtd)); }
59 * XML representation from loaded document
61 * \warning Need previous initialization and parsing
63 std::string asXmlString() const throw() { Compiler c; return (c.apply(a_rootNode)); }
68 Nombre del fichero indicado como parametro al invocar a Document::initialize
70 std::string a_filename;
73 const anna::xml::Node * a_rootNode;
74 virtual _xmlDoc* do_initialize(const char* filename) throw(RuntimeException);
75 virtual _xmlDoc* do_initialize(const anna::DataBlock&) throw(RuntimeException);