Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Element Class Reference

#include <elm/xom/dtd.h>

+ Inheritance diagram for Element:

Public Member Functions

 Element (xom::String name)
 
 Element (xom::String name, Content &content)
 
 ~Element ()
 
xom::String name () const
 
Contentcontent () 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)
 
- Public Member Functions inherited from Content
virtual ~Content (void)
 

Protected Member Functions

void reset () override
 
bool parse (Parser &parser) override
 
- Protected Member Functions inherited from Content
bool doParse (Content &content, Parser &parser)
 

Detailed Description

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:

dtd::Element cfg(dtd::make("cfg")
.attr(id)
.content((*property, entry, *bb, exit, *edge)));

Constructor & Destructor Documentation

◆ Element() [1/2]

Element ( xom::String  name)

Build an empty DTD element.

Parameters
nameElement name.

◆ Element() [2/2]

Element ( xom::String  name,
Content content 
)

Build an element with the given content.

Parameters
nameElement name.
contentElement content.

◆ ~Element()

~Element ( )

Member Function Documentation

◆ attributes()

const Vector<AbstractAttribute *>& attributes ( ) const
inline

◆ content()

Content & content ( ) const
inline

Get the content of the element.

Returns
Element content.

◆ name()

xom::String name ( ) const
inline

Get the name of the element.

Returns
Element name.

Referenced by Element::parse().

◆ operator!=()

bool operator!= ( const Element element) const
inline

References elm::operator==().

◆ operator==()

bool operator== ( const Element element) const
inline

◆ parse() [1/5]

void parse ( Factory factory,
io::InStream in,
t::uint32  flags = Parser::CROP 
)

Parse the current DTD element from the given input stream.

Parameters
factoryFactory to call for the parsed elements.
inInput stream to read from.
flagsFlags for parsing (default set to Parser::CROP).
Exceptions
ExceptionThrown if there is a format error.
ExceptionThrown if there is an IO error.

References Parser::parse().

◆ parse() [2/5]

void parse ( Factory factory,
string  uri,
t::uint32  flags = Parser::CROP 
)

Parse the current DTD element from the given URI.

Parameters
factoryFactory to call for the parsed elements.
uriURI to parse.
flagsFlags for parsing (default set to Parser::CROP).
Exceptions
ExceptionThrown if there is a format error.
ExceptionThrown if there is an IO error.

References String::asSysString(), and Parser::parse().

◆ parse() [3/5]

void parse ( Factory factory,
xom::Document doc,
t::uint32  flags = Parser::CROP 
)

Parse the current DTD element from the given XML document.

Parameters
factoryFactory to call for the parsed elements.
docXML document to parse.
flagsFlags for parsing (default set to Parser::CROP).
Exceptions
ExceptionThrown if there is a format error.

References Document::getRootElement(), and Parser::parse().

◆ parse() [4/5]

void parse ( Factory factory,
xom::Element element,
t::uint32  flags = Parser::CROP 
)

Parse the current DTD element from the given XML element.

Parameters
factoryFactory to call for the parsed elements.
elementXML element to parse.
flagsFlags for parsing (default set to Parser::CROP).
Exceptions
ExceptionThrown if there is a format error.

References Parser::parse().

Referenced by Element::parse().

◆ parse() [5/5]

bool parse ( Parser parser)
overrideprotectedvirtual

Parse the content of the current element in the parser.

Parameters
parserParser 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().

◆ reset()

void reset ( )
overrideprotectedvirtual

Called to reset the state of the content internals.

Implements Content.


The documentation for this class was generated from the following files:
elm::dtd::Element::content
Content & content() const
Definition: dtd.h:180