Default implementation for XML documents. More...
#include <ilog/xml.h>
Public Member Functions | |
| virtual void | addNode (IlXmlNodeI *) |
| Adds a new node. More... | |
| virtual IlXmlNodeIteratorI * | createNodesIterator () const |
| Creates an iterator for the nodes of this document. More... | |
| virtual void | empty () |
| Empties this document. More... | |
| IlXmlElement * | getRootElement () const |
| Gets the root element of this document. More... | |
| virtual const char * | getVersion () const |
| Gets the version of the document. More... | |
Public Member Functions inherited from IlXmlDocumentI | |
| virtual | ~IlXmlDocumentI () |
| Destructor. More... | |
| virtual void | attributeAdded (IlXmlElementI *element, IlXmlAttributeI *attribute) |
| Receives notification of the creation of an attribute. More... | |
| virtual void | cDataAdded (IlXmlCDataI *cdata) |
| Receives notification of the creation of a CDATA node. More... | |
| virtual void | charRefAdded (IlXmlCharRefI *charRef) |
Receives notification of the creation of a CharRef. More... | |
| virtual void | commentAdded (IlXmlCommentI *comment) |
| Receives notification of the creation of a comment. More... | |
| virtual IlXmlAttributeI * | createAttribute (IlXmlElementI *element, char *name, char *value) const |
| Creates a new XML attribute for a given element. More... | |
| virtual IlXmlCDataI * | createCData () const |
| Creates a new XML CDATA node. More... | |
| virtual IlXmlCharRefI * | createCharRef () const |
| Creates a new XML CharRef node. More... | |
| virtual IlXmlCommentI * | createComment () const |
| Creates a new XML comment node. More... | |
| virtual IlXmlElementI * | createElement (char *tag) const |
| Creates a new XML element. More... | |
| virtual IlXmlPII * | createPI () const |
| Creates a new XML processing instruction node. More... | |
| virtual IlXmlTextI * | createText () const |
| Creates a new XML text node. More... | |
| virtual void | endElement (IlXmlElementI *element) |
| Receives notification of the end of an element. More... | |
| virtual IlXmlNodeFactory * | getNodeFactory () const |
| Gets the node factory of this document. More... | |
| virtual void | processingInstructionAdded (IlXmlPII *pi) |
| Receives notification of the creation of a processing instruction node. More... | |
| void | read (std::istream &stream) |
| Reads an XML document. More... | |
| virtual void | startElement (IlXmlElementI *element) |
| Receives notification of the creation of an element. More... | |
| virtual void | textAdded (IlXmlTextI *text) |
| Receives notification of the creation of a text node. More... | |
| virtual std::ostream & | write (std::ostream &stream) const |
| Writes an XML document. More... | |
| virtual void | writeNodes (std::ostream &stream) const |
| Writes the XML nodes of this document. More... | |
Protected Member Functions | |
| virtual void | storeVersion (char *version) |
| Stores the XML version. More... | |
Default implementation for XML documents.
Library: ilog
This class can create, parse or output entire XML documents.
IlXmlDocument is a predefined type, derived from IlXmlDocumentI, that implements all the code that builds and holds a complete XML document that can be read from a stream.
You can use an XML document if you need a ready-to-use, efficient way of reading XML data that does not need streaming.
|
virtual |
Adds a new node.
This method is called when the XML parser creates a top-level node. It can be an element (then it is unique, and considered as the root element of the document), a comment or a processing instruction.
| node | A pointer to the new node. |
Implements IlXmlDocumentI.
|
virtual |
Creates an iterator for the nodes of this document.
Reimplemented from IlXmlDocumentI.
|
virtual |
Empties this document.
Removes and destroys all the nodes stored in this document. The default implementation does nothing.
Reimplemented from IlXmlDocumentI.
| IlXmlElement* IlXmlDocument::getRootElement | ( | ) | const |
Gets the root element of this document.
An XML document may have one and only one root element, that may store several child nodes.
Element node type).
|
virtual |
Gets the version of the document.
The default implementation returns the string "1.0".
storeVersion(). Reimplemented from IlXmlDocumentI.
|
protectedvirtual |
Stores the XML version.
The default implementation deletes the string and does not store it anywhere.
| version | The new version of this document. The string is stored as is and is not copied by the document. |
Reimplemented from IlXmlDocumentI.