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_DocumentMemory_hpp
10 #define anna_xml_DocumentMemory_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 buffer Cstring.
23 class DocumentMemory : public Document {
28 DocumentMemory() : 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 * Parse xml document and return root node
40 * \warning Need previous initialization
42 const Node* parse() throw(RuntimeException) { return (a_rootNode = Document::parse()); }
45 * Parse xml document with dtd and return root node
46 * \param dtd Validation DTD for XML document
48 * \warning Need previous initialization
50 const Node* parse(const DTD& dtd) throw(RuntimeException) { return (a_rootNode = Document::parse(dtd)); }
53 * XML representation from loaded document
55 * \warning Need previous initialization and parsing
57 std::string asXmlString() const throw() { Compiler c; return (c.apply(a_rootNode)); }
60 const anna::xml::Node * a_rootNode;
61 virtual _xmlDoc* do_initialize(const char* content) throw(RuntimeException);
62 virtual _xmlDoc* do_initialize(const anna::DataBlock&) throw(RuntimeException);