#include <xmldoc.h>
Inheritance diagram for freedaisy::XMLDoc:
Public Member Functions | |
XMLDoc () | |
Create an empty document. | |
XMLDoc (std::string filename) | |
Create the object and parse a document. | |
~XMLDoc () | |
Delete an XML document. | |
void | parseFile (std::string filename) |
Parse an XML document. | |
void | saveFile (std::string filename) |
Save the tree into an XML file. | |
void | createDoc () |
Create an XML document. | |
std::vector< XMLNode > | xpathEval (std::string request) |
Evaluate an XPath request. | |
xmlDocPtr | getC () |
Gets the C xmlDocPtr object. | |
XMLNode | createRootNode (std::string name) |
Create the root node. | |
Protected Member Functions | |
void | _createDoc () |
Create the XML document. | |
Protected Attributes | |
xmlDocPtr | _xmldoc |
libxml2 object |
Example:
freedaisy::XMLDoc doc("file.xml"); std::cout << doc.xpathEval("//root/test")[0].getContent() << std::endl;
Definition at line 21 of file xmldoc.h.
|
Create the object and parse a document.
Definition at line 12 of file xmldoc.cpp. References _xmldoc, and parseFile(). |
|
Create the XML document. This function is called by createDoc() to create the XML document. The goal of createDoc() is to be modified by child classes, this function helps to have the same XML creation function and avoid code duplication. Definition at line 41 of file xmldoc.cpp. References _xmldoc. Referenced by createDoc(), freedaisy::SMIL::createDoc(), freedaisy::NCC::createDoc(), and freedaisy::Discinfo::createDoc(). |
|
Create the root node.
Definition at line 72 of file xmldoc.cpp. References _xmldoc. Referenced by freedaisy::SMIL::createDoc(), freedaisy::NCC::createDoc(), and freedaisy::Discinfo::createDoc(). |
|
Parse an XML document.
Definition at line 21 of file xmldoc.cpp. References _xmldoc. Referenced by XMLDoc(). |
|
Save the tree into an XML file.
Definition at line 31 of file xmldoc.cpp. References _xmldoc. |
|
Evaluate an XPath request.
Definition at line 55 of file xmldoc.cpp. References _xmldoc. Referenced by freedaisy::Discinfo::addLink(), freedaisy::NCC::addMeta(), freedaisy::Discinfo::delLink(), freedaisy::SMIL::findAnchor(), freedaisy::NCC::getBody(), freedaisy::NCC::getLang(), freedaisy::Discinfo::getLang(), freedaisy::Discinfo::getLinks(), freedaisy::NCC::getMeta(), freedaisy::NCC::getPage(), freedaisy::NCC::getTitle(), freedaisy::NCC::setLang(), freedaisy::Discinfo::setLang(), and freedaisy::NCC::setTitle(). |