pub enum SaxElement<'a> {
StartTag(&'a str),
Attribute(&'a str, &'a str),
StartTagContent,
StartTagEmpty,
EndTag(&'a str),
CData(&'a str),
}Expand description
An XML element returned from the parser.
Variants§
StartTag(&'a str)
A start tag or empty element tag.
The argument is the full name of the tag. This element is sent to the handler as soon as the name is parsed.
This is always followed by zero or more Attribute elements, and then either a StartTagContent or StartTagEmpty element.
Attribute(&'a str, &'a str)
A tag attribute for the last StartTag.
First argument is the attribute name and the second argument is the attribute value. All references in the attribute value are replaced with the actual characters. Each attribute is sent as a separate element for efficiency.
StartTagContent
Indicates that the last StartTag was not an empty element tag.
Note that you might still get an EndTag
immediately after this, as <tag/> and <tag></tag> are
distinct in the XML specification, and not normalized.
StartTagEmpty
Indicates that the last StartTag was an empty element tag and will have no content.
EndTag(&'a str)
An end tag element.
The argument is the full name of the end tag.
CData(&'a str)
A character data element.
The argument is the text content. Note that you might get this element several times with different parts of the content for a single continous block of text. When you parse the document in multiple parse calls, or when the parser encounters a reference to substitute, collected content is flushed. The DocumentParser of iksemel automatically concatenates these parts to build a seamless document model.