Skip to content

what's BytesStart::unescaped for? #341

@scottlamb

Description

@scottlamb

I'm trying to switch to quick-xml and am struggling to understand the API for just getting strings (for tag names, attribute names, attribute values, and text/cdata nodes).

I saw that the caller must unescaped text/cdata/attribute values, and this comment that the caller must decode the character encoding.

Next question: what is BytesStart::unescaped for? It says it handles escapes/entities like < but that doesn't make sense to me. Is this the right grammar for the XML tag name from the spec?

NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
Name ::= NameStartChar (NameChar)*

It looks like a & (aka #x26) isn't allowed. So why unescape? or what am I missing?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions