![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/xom/dtd.h>
Public Member Functions | |
Element (xom::String name) | |
Element (xom::String name, Content &content) | |
~Element () | |
xom::String | name () const |
Content & | content () const |
const Vector< AbstractAttribute * > & | attributes () const |
bool | operator== (const Element &element) const |
bool | operator!= (const Element &element) const |
void | parse (Factory &factory, xom::Element *element, t::uint32 flags=Parser::CROP) |
void | parse (Factory &factory, xom::Document *doc, t::uint32 flags=Parser::CROP) |
void | parse (Factory &factory, string uri, t::uint32 flags=Parser::CROP) |
void | parse (Factory &factory, io::InStream &in, t::uint32 flags=Parser::CROP) |
![]() | |
virtual | ~Content (void) |
Protected Member Functions | |
void | reset () override |
bool | parse (Parser &parser) override |
![]() | |
bool | doParse (Content &content, Parser &parser) |
DTD description of an XML element. It is made of zero or several attributes and of a content. This content may be sub-elements, text, sequence of elements, repetition of elements, alternative of elements or optional elements.
The easiest way to create an element is to use the Make constructor:
Element | ( | xom::String | name | ) |
Build an empty DTD element.
name | Element name. |
Element | ( | xom::String | name, |
Content & | content | ||
) |
~Element | ( | ) |
|
inline |
|
inline |
References elm::operator==().
void parse | ( | Factory & | factory, |
io::InStream & | in, | ||
t::uint32 | flags = Parser::CROP |
||
) |
Parse the current DTD element from the given input stream.
factory | Factory to call for the parsed elements. |
in | Input stream to read from. |
flags | Flags for parsing (default set to Parser::CROP). |
References Parser::parse().
void parse | ( | Factory & | factory, |
string | uri, | ||
t::uint32 | flags = Parser::CROP |
||
) |
Parse the current DTD element from the given URI.
factory | Factory to call for the parsed elements. |
uri | URI to parse. |
flags | Flags for parsing (default set to Parser::CROP). |
References String::asSysString(), and Parser::parse().
void parse | ( | Factory & | factory, |
xom::Document * | doc, | ||
t::uint32 | flags = Parser::CROP |
||
) |
Parse the current DTD element from the given XML document.
factory | Factory to call for the parsed elements. |
doc | XML document to parse. |
flags | Flags for parsing (default set to Parser::CROP). |
Exception | Thrown if there is a format error. |
References Document::getRootElement(), and Parser::parse().
void parse | ( | Factory & | factory, |
xom::Element * | element, | ||
t::uint32 | flags = Parser::CROP |
||
) |
Parse the current DTD element from the given XML element.
factory | Factory to call for the parsed elements. |
element | XML element to parse. |
flags | Flags for parsing (default set to Parser::CROP). |
Exception | Thrown if there is a format error. |
References Parser::parse().
Referenced by Element::parse().
Parse the content of the current element in the parser.
parser | Parser to parse with. |
Implements Content.
References Parser::asElement(), Parser::begin(), Parser::current(), Node::ELEMENT, Parser::end(), Parser::ended(), Element::getLocalName(), Node::kind(), Element::name(), Content::parse(), Element::parse(), and Parser::recordError().
|
overrideprotectedvirtual |
Called to reset the state of the content internals.
Implements Content.