class DECLSPEC XMLIO_Element

Most important class to read and write from an XML file.

Inheritance:


Public Fields

[more]XMLIO_string tag
Tag of element.
[more]XMLIO_Attributes attributes
Keeps attributes of element.
[more]XMLIO_IndentationType xmlio_indent_type
Indentation tyle of element.

Public Methods

[more] XMLIO_Element ()
Constructor.
[more] XMLIO_Element (const XMLIO_string& my_tag, XMLIO_Attributes &my_attributes)
Constructor.
[more]virtual ~XMLIO_Element ()
Destructor.
[more]virtual XMLIO_Element* XMLIO_startTag (const XMLIO_string& tag, XMLIO_Attributes &attrs)
Called by XMLIO_Document when a start tag is received.
[more]virtual void XMLIO_endTag (const XMLIO_string& tag)
Called by XMLIO_Document when a end tag is found.
[more]virtual void XMLIO_getCharacters (const XMLIO_string& characters)
All character data will be send to your element.
[more]virtual void XMLIO_getComment (const XMLIO_string& comment)
The comment characters are sent to the element (XML Spec [15]).
[more]virtual void XMLIO_getProcessingInstruction (const XMLIO_string& target, const XMLIO_string& instructions)
The process instruction is sent to the element (XML Spec [16]).
[more]virtual void XMLIO_finishedReading ()
Called by XMLIO_Document when the end tag of this element has been found.
[more]virtual bool XMLIO_remove () const
Returns whether object should be deleted from memory by the XMLIO_Document when it is removed from the stack.
[more]virtual const int XMLIO_writeContent (XMLIO_Document& doc)
Writes the content (XML Spec[43]) of this element.
[more]virtual const XMLIO_string& XMLIO_getName () const
Returns the XML element's type of this element (as in XML Spec[40]).
[more]virtual XMLIO_Attributes& XMLIO_getAttributes ()
Returns the attributes of this element (XML Spec [40], [41]).
[more]virtual bool XMLIO_isEmpty () const
Returns whether this element is empty (XML Spec [44]).
[more]virtual const char* toString () const
Returns name of class.
[more]virtual void print () const


Documentation

Most important class to read and write from an XML file. It represents an XML element in the sense of XML spec [39] and any object, that can be composed out of the data of an XML element, should be derived from this class. You will have to overload some of the virtual functions to handle the incoming data yourself.
In order to provide specialized output support, you should write code to the functions Only if XMLIO_isEmpty() returns false, the XMLIO_write method is called.
o XMLIO_Element()
Constructor. The tag of this element is set to "XMLIO_Element"

o XMLIO_Element(const XMLIO_string& my_tag, XMLIO_Attributes &my_attributes)
Constructor. Some constructors need information for initialisation. Tag and attributes are stored!

ovirtual ~XMLIO_Element()
Destructor.

ovirtual XMLIO_Element* XMLIO_startTag(const XMLIO_string& tag, XMLIO_Attributes &attrs)
Called by XMLIO_Document when a start tag is received. Tag and attributes are passed to this function. This function returns an XMLIO_Element which should receive all data of the following element. If you are not interested in the element's and all nested elements' data you should return NULL. This is equal to return a new XMLIO_IgnoreElement(). All data of the element and all nested elements will just be ignored. If this object should also receive the data of the incoming element you should return 'this'. By default this function does nothing and returns NULL.

ovirtual void XMLIO_endTag(const XMLIO_string& tag)
Called by XMLIO_Document when a end tag is found. This happens when a sub element has finished reading its content. By default this function does nothing.

ovirtual void XMLIO_getCharacters(const XMLIO_string& characters)
All character data will be send to your element. This function might be called multiple times since all character data that is read so far will be send to this element before a XMLIO_startTag event is passed to it. Hence the XMLIO_Document collects all characters until either a sub element or the end of this element is found. By default this function does nothing, thus all character data will be lost.

ovirtual void XMLIO_getComment(const XMLIO_string& comment)
The comment characters are sent to the element (XML Spec [15]). Each comment results in a call.

ovirtual void XMLIO_getProcessingInstruction(const XMLIO_string& target, const XMLIO_string& instructions)
The process instruction is sent to the element (XML Spec [16]). The instruction is divided into the two parts target (XML Spec [17]) and instructions.

ovirtual void XMLIO_finishedReading()
Called by XMLIO_Document when the end tag of this element has been found. This just informs the element that no further data will be passed to it. This can be usefull to check whether all required data has been read or to build up some final data structures.

ovirtual bool XMLIO_remove() const
Returns whether object should be deleted from memory by the XMLIO_Document when it is removed from the stack. By default this returns false and you usually isn't useful to change this. One example for an exception to this is XMLIO_IgnoreElement.

ovirtual const int XMLIO_writeContent(XMLIO_Document& doc)
Writes the content (XML Spec[43]) of this element. You should use the public XMLIO_Document::write* functions.
Returns:
Returns the number of bytes written, but is negative when an error occured and 0 by default.

ovirtual const XMLIO_string& XMLIO_getName() const
Returns the XML element's type of this element (as in XML Spec[40]). By default returns content of variable 'tag'.

ovirtual XMLIO_Attributes& XMLIO_getAttributes()
Returns the attributes of this element (XML Spec [40], [41]). By default returns content of variable 'attributes'.

ovirtual bool XMLIO_isEmpty() const
Returns whether this element is empty (XML Spec [44]). By default this returns false. If it returns true, XMLIO_writeContent is not called

ovirtual const char* toString() const
Returns name of class.

ovirtual void print() const
Deprecated:
OPEN DISCUSSION.

oXMLIO_string tag
Tag of element. You have to set this manualy.

oXMLIO_Attributes attributes
Keeps attributes of element. You have to set this manualy.

oXMLIO_IndentationType xmlio_indent_type
Indentation tyle of element.


Direct child classes:
gxl_typedElement
Clustering
Cluster
XMLIO_StringElement
XMLIO_StoreElement
XMLIO_SingleElement
XMLIO_IgnoreElement
XMLIO_ElementArrayElement
XMLIO_Document
XMLIO_ContentElementArrayElement
XMLIO_AttributedElement
XMLIO_ArrayElement

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.