Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/xom/dtd.h>
Public Member Functions | |
virtual | ~Factory () |
virtual void | begin (Element &element) |
virtual void | end (Element &element) |
virtual void | backtrack (Element &element) |
virtual void * | getRef (Element &element) |
virtual void | getPCDATA (xom::String data) |
virtual void | patch (AbstractAttribute &attr, void *object, void *ref) |
virtual void * | getPatchRef (AbstractAttribute &attr) |
virtual void | getAny (xom::Node *node) |
A factory is an interface with the DTD parser to let the application build its internal data structure the read XML elements.
Each time an element is found, the begin() function is called and the DTD attributes contains the element attribute values. When the element is exited, an end() is called. backtrack() is called if an error is found in the current element to let the application clean up its internal data structure.
If the XML identifier/reference is used, a pointer to the application internal data structure is obtained, when an ID attribute is found, by a call to getRef().
|
virtual |
Called when the analysis of an element has failed. Its allocated resources can now be released. The element attributes may have their value overwritten in the use in other elements.
element | Failed element. |
Called each time an element is entered. At this time, the attribute has been initialized and their value can be used.
Entered | element. |
Called each time an element is completed.
element | Completed element. |
Function called when an ANY content is parsed. It is called for XML node composing the ANY content.
node | Found node. |
Referenced by AnyContent::parse().
|
virtual |
This function is called to get a patch object for non-resolved forward references. The returned object will then be used to patch the missing reference when the function patch() is called.
The default implementation returns a null pointer.
attr | DTD reference attribute that is unresolved. |
|
virtual |
Function called when the CDATA of an element is parsed, to pass the found text to the application.
data | CDATA found in the current element. |
Referenced by PCDATAContent::parse().
This function is called to get a reference on the current element. It is called after an begin() and if one of the attribute of the element is a reference.
element | Current element. |
|
virtual |
Function called to perform a backpatch. A backpatch is needed when a reference attribute is treated with a forward reference. As the reference cannot be processed immediately (the reference object is not already defined), this reference is recorded and a call to this function is performed as soon as the reference can be solved.
The default implementation does nothing.
attr | DTD attribute corresponding to the reference to patch. |
object | Object obtained by a call to getPatchRef(). |
ref | Solved reference to patch. |