Upgrading quick-xml 0.31 to 0.32
Breaking0.31.0 → 0.32.0Breaking17New14Changed7Fixed6Other1
BreakingUpgrade verdict
14 breaking changes.
In plain terms
- Entity unescaping no longer handles the five built-in XML entities, and one resolver type has a new name.
- Error values returned by the parser have changed, so code that matches on specific error variants may need updating.
- Removes the unused Error::TextNotFound variant.
- If you read where errors happen, the way that location is reported has changed.
Must act Top 3 of 14 that need code or config changes
What you must change
Breaking14
Changes unescape_with so it no longer resolves predefined entities (lt, gt, apos, quot, amp), and renames NoEntityResolver to PredefinedEntityResolver.
unescape_withNoEntityResolverPredefinedEntityResolverReworks the quick_xml::Error type, replacing or removing several variants for more accurate error information.
quick_xml::ErrorError::EndEventMismatchIllFormedError::MismatchedEndTagIllFormedError::UnmatchedEndTagError::TextNotFoundError::UnexpectedBangError::UnexpectedEofError::UnexpectedTokenRemoves the unused Error::TextNotFound variant.
Error::TextNotFoundChanges how error positions are reported; use error_position() to get the error offset, and for SyntaxErrors the span is error_position()..buffer_position().
error_position()buffer_position()SyntaxErrorMoves all parser configuration into the Config struct, applied at once, and makes it serializable when the serde-types feature is enabled.
Configserde-typesChanges Writer::create_element to accept impl Into<Cow<str>> instead of &impl AsRef<str>.
Writer::create_elementAllows passing owned strings to Writer::create_element, which is a breaking change.
Writer::create_elementReplaces Error::UnexpectedBang with SyntaxError.
Error::UnexpectedBangSyntaxErrorReplaces Error::UnexpectedEof with SyntaxError in some cases.
Error::UnexpectedEofSyntaxErrorReplaces Error::UnexpectedEof with IllFormedError in some cases.
Error::UnexpectedEofIllFormedErrorReplaces Error::UnexpectedToken with IllFormedError::DoubleHyphenInComment.
Error::UnexpectedTokenIllFormedError::DoubleHyphenInCommentReplaces Error::XmlDeclWithoutVersion with IllFormedError::MissingDeclVersion.
Error::XmlDeclWithoutVersionIllFormedError::MissingDeclVersionReplaces Error::EmptyDocType with IllFormedError::MissingDoctypeName.
Error::EmptyDocTypeIllFormedError::MissingDoctypeNameStops resolving predefined entities in unescape_with methods; callers must resolve them using the provided resolve functions.
unescape_withquick_xml::escape::resolve_predefined_entityquick_xml::escape::resolve_xml_entityquick_xml::escape::resolve_html5_entity