Skip to content

simple_xml

“Simple” XML to canonical string parser

Attributes

STATE_CONTENT module-attribute

STATE_CONTENT = 'content'

STATE_INITIAL module-attribute

STATE_INITIAL = 'INITIAL'

states module-attribute

states = ((STATE_CONTENT, 'exclusive'))

t_content_ATTRIBUTE module-attribute

t_content_ATTRIBUTE = t_ATTRIBUTE

t_content_TAG_CLOSE module-attribute

t_content_TAG_CLOSE = t_TAG_CLOSE

t_content_TAG_NAME module-attribute

t_content_TAG_NAME = t_TAG_NAME

t_content_error module-attribute

t_content_error = t_error

tokens module-attribute

tokens = (
    "TAG_OPEN",
    "TAG_NAME",
    "ATTRIBUTE",
    "TAG_CLOSE",
    "CONTENT",
)

Classes

SimpleXML

SimpleXML(env: Environment)

Bases: BaseCanonical

Attributes

name property
name: str

Functions

to_canonical
to_canonical(data: str, **kwargs) -> CanonicalChat

Functions

t_ATTRIBUTE

t_ATTRIBUTE(t: LexToken)

name=”[^”]*”

t_TAG_CLOSE

t_TAG_CLOSE(t: LexToken)

t_TAG_NAME

t_TAG_NAME(t: LexToken)

[a-zA-Z0-9_]+

t_TAG_OPEN

t_TAG_OPEN(t: LexToken)

<

t_WHITESPACE

t_WHITESPACE(t: LexToken)

\s+

t_content_CONTENT

t_content_CONTENT(t: LexToken)

[^<]+

t_content_TAG_OPEN

t_content_TAG_OPEN(t: LexToken)

<

t_error

t_error(t: LexToken)