Enum xmlparser::Token
[−]
[src]
pub enum Token<'a> {
Declaration(StrSpan<'a>, Option<StrSpan<'a>>, Option<StrSpan<'a>>),
ProcessingInstruction(StrSpan<'a>, Option<StrSpan<'a>>),
Comment(StrSpan<'a>),
DtdStart(StrSpan<'a>, Option<ExternalId<'a>>),
EmptyDtd(StrSpan<'a>, Option<ExternalId<'a>>),
EntityDeclaration(StrSpan<'a>, EntityDefinition<'a>),
DtdEnd,
ElementStart(StrSpan<'a>),
Attribute(StrSpan<'a>, StrSpan<'a>),
ElementEnd(ElementEnd<'a>),
Text(StrSpan<'a>),
Whitespaces(StrSpan<'a>),
Cdata(StrSpan<'a>),
}An XML token.
Variants
Declaration(StrSpan<'a>, Option<StrSpan<'a>>, Option<StrSpan<'a>>)Declaration token.
Example: <?xml version="1.0"?>
ProcessingInstruction(StrSpan<'a>, Option<StrSpan<'a>>)Processing instruction token.
Example: <?target content?>
Comment(StrSpan<'a>)The comment token.
Example: <!-- text -->
DtdStart(StrSpan<'a>, Option<ExternalId<'a>>)DOCTYPE start token.
Example: <!DOCTYPE note [
EmptyDtd(StrSpan<'a>, Option<ExternalId<'a>>)Empty DOCTYPE token.
Example: <!DOCTYPE note>
EntityDeclaration(StrSpan<'a>, EntityDefinition<'a>)ENTITY token.
Can appear only inside the DTD.
Example: <!ENTITY ns_extend "http://test.com">
DtdEndDOCTYPE end token.
Example: ]>
ElementStart(StrSpan<'a>)Element start token.
Example: <elem
Attribute(StrSpan<'a>, StrSpan<'a>)Attribute.
Example: name="value"
ElementEnd(ElementEnd<'a>)Element end token.
Text(StrSpan<'a>)Text token.
Contains text between elements including whitespaces.
Basically everything between > and <.
Contains text as is. Use TextUnescape to unescape it.
Example: <text>text</text>
Whitespaces(StrSpan<'a>)Whitespaces token.
The same as Text token, but contains only spaces.
Spaces can be encoded like  .
Cdata(StrSpan<'a>)CDATA token.
Example: <![CDATA[text]]>