ElementParser

Undocumented in source.

Constructors

this
this(ElementParser parent)
Undocumented in source.
this
this(Tag tag, string* t)
Undocumented in source.
this
this()
Undocumented in source.

Members

Aliases

ElementHandler
alias ElementHandler = void delegate(in Element element)
Undocumented in source.
Handler
alias Handler = void delegate(string)
Undocumented in source.
ParserHandler
alias ParserHandler = void delegate(ElementParser parser)
Undocumented in source.

Functions

onTextRaw
void onTextRaw(Handler handler)

Register an alternative handler which will be called whenever text is encountered. This differs from onText in that onText will decode the text, whereas onTextRaw will not. This allows you to make design choices, since onText will be more accurate, but slower, while onTextRaw will be faster, but less accurate. Of course, you can still call decode() within your handler, if you want, but you'd probably want to use onTextRaw only in circumstances where you know that decoding is unnecessary.

parse
void parse()

Parse an XML element.

toString
string toString()

Returns that part of the element which has already been parsed

Properties

onCData
Handler onCData [@property setter]

Register a handler which will be called whenever a character data segment is encountered.

onComment
Handler onComment [@property setter]

Register a handler which will be called whenever a comment is encountered.

onPI
Handler onPI [@property setter]

Register a handler which will be called whenever a processing instruction is encountered.

onText
Handler onText [@property setter]

Register a handler which will be called whenever text is encountered.

onXI
Handler onXI [@property setter]

Register a handler which will be called whenever an XML instruction is encountered.

tag
const(Tag) tag [@property getter]

The Tag at the start of the element being parsed. You can read this to determine the tag's name and attributes.

Variables

cdataHandler
Handler cdataHandler;
Undocumented in source.
commentHandler
Handler commentHandler;
Undocumented in source.
elementStart
string elementStart;
Undocumented in source.
onEndTag
ElementHandler[string] onEndTag;

Register a handler which will be called whenever an end tag is encountered which matches the specified name. You can also pass null as the name, in which case the handler will be called for any unmatched end tag.

onStartTag
ParserHandler[string] onStartTag;

Register a handler which will be called whenever a start tag is encountered which matches the specified name. You can also pass null as the name, in which case the handler will be called for any unmatched start tag.

piHandler
Handler piHandler;
Undocumented in source.
rawTextHandler
Handler rawTextHandler;
Undocumented in source.
s
string* s;
Undocumented in source.
tag_
Tag tag_;
Undocumented in source.
textHandler
Handler textHandler;
Undocumented in source.
xiHandler
Handler xiHandler;
Undocumented in source.

Meta