This class offers functions to extract information from an XML file. It uses the xPath functions of the library libXML.
More...
Inherits noncopyable.
|
| XMLParser (const std::string &fileName, bool validateFile) |
| constructor More...
|
|
| XMLParser (const std::string &data) |
| constructor More...
|
|
virtual | ~XMLParser () |
| destructor
|
|
virtual void | createFile () |
| this method starts the creation of an xml file. It is the first method you have to call in order to create the xml file
|
|
virtual void | startDocument () |
| this method writes the xml directive into the file, starting the xml document
|
|
virtual void | endDocument () |
| this method ends the xml document, freeing the xml writer interface
|
|
virtual void | startElement (const std::string element) |
| this method starts a new element tag More...
|
|
virtual void | writeElement (const std::string element, const std::string elementValue) |
| this method writes an element and its value into the current file More...
|
|
virtual void | endElement () |
| this method ends a new element tag
|
|
virtual void | writeString (const std::string text) |
| this method writes a string into the xml document More...
|
|
virtual void | writeNewline () |
| this method starts a new line in the xml document
|
|
virtual void | writeAttribute (const std::string attributeName, const std::string attributeValue) |
| this method adds an attribute to the current element that is being edited More...
|
|
virtual boost::optional
< std::vector
< boost::shared_ptr
< ElementXML > > > | extractElementsFromXPath (const std::string &xpathExpr) const |
| Extracts information from an XML file by searching for an xPath expression. More...
|
|
virtual boost::optional
< boost::ptr_vector
< ElementXML > > | getElementsFromXPath (const std::string &xpathExpression) const |
| Retrieve the elements identified by the XPath expression from the XML file. More...
|
|
std::auto_ptr< ElementXML > | getElementFromXPath (const std::string &xpathExpression) const |
| Retrieve the first element identified by the XPath expression from the XML file. More...
|
|
std::string | getElementContentFromXPath (const std::string &xpath) const |
|
virtual boost::optional
< std::vector
< boost::shared_ptr
< ElementXML > > > | extractElements (const std::string &elementName) const |
| extracts information from an XML file by searching for a XML element name More...
|
|
virtual boost::optional
< boost::ptr_vector
< ElementXML > > | getElements (const std::string &elementName) const |
| Retrieve the elements with the given name from the XML file. More...
|
|
virtual boost::optional
< AttributeXML > | extractAttribute (const std::string &elementName, const std::string &attributeName) const |
| Extracts information from an XML file by searching for a XML attribute in an XML element. More...
|
|
This class offers functions to extract information from an XML file. It uses the xPath functions of the library libXML.