pub enum XmlState {
Show 43 variants
Data,
TagState,
EndTagState,
EndTagName,
EndTagNameAfter,
Pi,
PiTarget,
PiTargetAfter,
PiData,
PiAfter,
MarkupDecl,
CommentStart,
CommentStartDash,
Comment,
CommentLessThan,
CommentLessThanBang,
CommentLessThanBangDash,
CommentLessThanBangDashDash,
CommentEnd,
CommentEndDash,
CommentEndBang,
Cdata,
CdataBracket,
CdataEnd,
TagName,
TagEmpty,
TagAttrNameBefore,
TagAttrName,
TagAttrNameAfter,
TagAttrValueBefore,
TagAttrValue(AttrValueKind),
Doctype,
BeforeDoctypeName,
DoctypeName,
AfterDoctypeName,
AfterDoctypeKeyword(DoctypeKind),
BeforeDoctypeIdentifier(DoctypeKind),
DoctypeIdentifierDoubleQuoted(DoctypeKind),
DoctypeIdentifierSingleQuoted(DoctypeKind),
AfterDoctypeIdentifier(DoctypeKind),
BetweenDoctypePublicAndSystemIdentifiers,
BogusDoctype,
BogusComment,
}Expand description
Specifies the different states a XML tokenizer will assume during parsing.
Variants§
Data
The initial state of the parser.
It is equivalent to the Data state of the html parser,
except null codepoints do not cause errors.
TagState
Indicates that the parser has found a < character and will try to parse a tag.
EndTagState
Indicates that the parser has consumed the / of a closing tag, like </foo>.
EndTagName
Indicates that the parser is currently parsing the name of a closing tag, like the foo of </foo>.
EndTagNameAfter
Indicates that the parser has finished parsing the name of a closing tag and expects a > to follow.
Pi
Indicates that the parser has started parsing a processing instruction (PI).
This state is reached after the initial ? character has been consumed.
PiTarget
Indicates that the parser is currently parsing the target of a processing instruction.
For example, the target of <?xml-stylesheet type="text/xsl" href="style.xsl"?> is xml-stylesheet.
PiTargetAfter
Indicates that the parser has finished parsing the target of a processing instruction.
PiData
Indicates that the parser is currently parsing the data of a processing instruction.
The “data” refers to everything between the target and the closing ? character.
PiAfter
Indicates that the parser has parsed the closing ? of a processing instruction.
MarkupDecl
Indicates that the parser has parsed the initial ! of a markup declaration.
Examples of such declarations include <!ENTITY chap1 SYSTEM "chap1.xml"> or <!-- Comment -->.
CommentStart
Indicates that the parser has parsed the start of a comment (<!--).
CommentStartDash
Indicates that the parser has parsed the start of a comment and a - directly after it.
Comment
Indicates that the parser is currently parsing the data within a comment.
CommentLessThan
Indicates that the parser has parsed a < character within a comment.
CommentLessThanBang
Indicates that the parser has parsed <! within a comment.
CommentLessThanBangDash
Indicates that the parser has parsed <!- within a comment.
CommentLessThanBangDashDash
Indicates that the parser has parsed <!-- within a comment.
CommentEnd
Indicates that the parser has parsed two - characters within a comment which may or may not
be the beginning of the comment end (-->).
CommentEndDash
Indicates that the parser has parsed a - character within a comment which may or may not
be the beginning of the comment end (-->).
CommentEndBang
Indicates that the parser has parsed --! within a comment which may or may not be part of the
end of the comment. Comments in XML can be closed with --!>.
Cdata
Indicates that the parser has parsed the beginning of a CDATA section (<![CDATA[).
CdataBracket
Indicates that the parser has parsed a ] character within a CDATA section, which may be part of
the end of the section (]]>).
CdataEnd
Indicates that the parser has parsed two ] characters within a CDATA section, which may be part of
the end of the section (]]>).
TagName
Indicates that the parser is currently parsing the name of a tag, such as foo in <foo>.
TagEmpty
Indicates that the parser has parsed the / of a self-closing tag, such as <foo/>.
TagAttrNameBefore
Indicates that the parser has finished parsing the name of a tag and is now expecting either attributes or
a >.
TagAttrName
Indicates that the parser is currently parsing the name of an attribute within a tag, such as
bar in <foo bar=baz>.
TagAttrNameAfter
Indicates that the parser has finished parsing the name of an attribute.
TagAttrValueBefore
Indicates that the parser is about to parse the value of an attribute.
TagAttrValue(AttrValueKind)
Indicates that the parser is currently parsing the value of an attribute, such as baz in
<foo bar=baz>.
Includes information about how the value is quoted, because the quotes before and after the attribute value need to match.
Doctype
Indicates that the parser has parsed the beginning of a document type definition (<!DOCTYPE).
BeforeDoctypeName
Indicates that the parser expects to parse the name of the document type definition next.
DoctypeName
Indicates that the parser is currently parsing the name of a document type definition, such as
html in <!DOCTYPE html>.
AfterDoctypeName
Indicates that the parser has finished parsing the name of the document type definition and now optionally expects either a public or a system identifier.
AfterDoctypeKeyword(DoctypeKind)
Indicates that the parser has parsed a keyword for either a public or system identifier (PUBLIC or SYSTEM).
BeforeDoctypeIdentifier(DoctypeKind)
Indicates that the parser is about to parse the value of a public or system identifier within
a document type definition, such as foo in
<!DOCTYPE html PUBLIC "foo" "bar">.
DoctypeIdentifierDoubleQuoted(DoctypeKind)
Indicates that the parser is currently parsing the value of a public or system identifier
that is surrounded by double quotes , such as foo in
<!DOCTYPE html PUBLIC "foo" "bar">.
DoctypeIdentifierSingleQuoted(DoctypeKind)
Indicates that the parser is currently parsing the value of a public or system identifier
that is surrounded by single quotes , such as foo in
<!DOCTYPE html PUBLIC 'foo' 'bar'>.
AfterDoctypeIdentifier(DoctypeKind)
Indicates that the parser has finished parsing either a public or system identifier within a document type definition.
BetweenDoctypePublicAndSystemIdentifiers
Indicates that the parser has finished parsing a public identifier and now expects a system identifier.
BogusDoctype
Indicates that the parser is currently parsing an ill-formed document type defintion, such as
<!DOCTYPE html what-is-this>.
BogusComment
Indicates that the parser is currently parsing an ill-formed comment, such as
<? this is not what a comment should look like! >.