Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/xom/dtd.h>
Public Types | |
typedef int | mark_t |
Public Member Functions | |
Parser (Factory &factory, Element &element, t::uint32 flags=CROP) | |
bool | doesCrop () const |
Factory & | factory (void) const |
Element & | element (void) const |
Option< xom::String > | get (xom::String name) const |
xom::Element * | asElement () const |
xom::Element * | parent () const |
bool | isEmpty () |
void | raise (const string &msg) const |
void | fail (const string &msg) const |
void | recordError () |
bool | ended () const |
xom::Node * | current (void) const |
void | next (void) |
mark_t | mark (void) |
bool | backtrack (mark_t m) |
void | begin (Element &element) |
void | end (bool success) |
bool | hasID (xom::String id) const |
void * | getID (xom::String id) const |
void | addPost (AbstractAttribute *att) |
void | recordPatch (xom::String id, AbstractAttribute &attr) |
void | recordID (xom::String id, Element &element) |
void | parse (xom::Element *xelt) |
Static Public Attributes | |
static const t::uint32 | CROP = 0x01 |
Parser for DTD module.
typedef int mark_t |
|
inline |
Referenced by IDAttribute::process(), and RefAttribute< T >::process().
|
inline |
Back track to a previously marked position.
mark | Position mark to bcktrak to. |
Referenced by Seq::parse(), and EmptyContent::parse().
Begin the given element (and move to first child).
element | Begun element. |
Referenced by Element::parse().
Get the current XML node.
References Node::node.
Referenced by Element::parse(), PCDATAContent::parse(), and AnyContent::parse().
|
inline |
Check the blank cropping option.
References elm::dtd::CROP.
End the current element.
Referenced by Element::parse().
|
inline |
Test if the iteration on the children of the current parent element is ended.
Referenced by Element::parse(), Optional::parse(), Seq::parse(), Repeat::parse(), EmptyContent::parse(), IgnoredContent::parse(), PCDATAContent::parse(), and AnyContent::parse().
Get the factory used by the parser.
Referenced by PCDATAContent::parse(), and AnyContent::parse().
Throw an exception for failure on the last recorded element.
msg | Message of the exception. |
|
inline |
Get an attribute value in the current XML element. This function can only be called if the current XML node is an element.
name | Attribute name. |
Referenced by AbstractAttribute::parse().
|
inline |
Get the value associated with the given identifier.
id | Looked identifier. |
Referenced by RefAttribute< T >::process().
|
inline |
Test if the given identifier is already assigned.
Referenced by IDAttribute::process(), and RefAttribute< T >::process().
bool isEmpty | ( | ) |
Test if the current node is empty, that is only composed of spaces.
References CString::length(), and Node::TEXT.
Referenced by EmptyContent::parse().
Get a mark on the current position.
Referenced by Seq::parse(), and EmptyContent::parse().
Move to the next child node.
Referenced by EmptyContent::parse(), IgnoredContent::parse(), PCDATAContent::parse(), and AnyContent::parse().
|
inline |
void parse | ( | xom::Element * | xelt | ) |
Parse the given XML element.
xelt | XML element to parse. |
Exception | If there is an error. |
References elm::_.
Referenced by Element::parse().
Throw an exception on the current node with the given message.
msg | Message of the exception. |
Referenced by IDAttribute::process(), and RefAttribute< T >::process().
|
inline |
Record the current node as supporting an error.
Referenced by Element::parse().
void recordID | ( | xom::String | id, |
Element & | element | ||
) |
Declare a new identifier and possibly resolves several pending references.
id | Set ID. |
element | Element where the ID is defined. |
References elm::io::p().
Referenced by IDAttribute::postprocess().
void recordPatch | ( | xom::String | id, |
AbstractAttribute & | attr | ||
) |
Record a patch for a forward reference attribute that is unresolved.
id | Forward reference identifier. |
attr | Attribute containing the forward reference identifier. |
References elm::io::p().
Referenced by RefAttribute< T >::postprocess().
|
static |