Update Rust crate quick-xml to 0.39 #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/quick-xml-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.31→0.39Release Notes
tafia/quick-xml (quick-xml)
v0.39.3Compare Source
Bug Fixes
Note, that currently we do not check the validity of DTD, so the returned
Event::DocTypemay contain the malformed DTD.
v0.39.2Compare Source
New Features
read_text_into()andread_text_into_async().Bug Fixes
<is the last in the
BufReadinternal buffer. This is the regression from #936.v0.39.1Compare Source
New Features
NamespaceResolver::set_levelwhich may be helpful in some circumstances.Bug Fixes
NsReader::read_to_endNsReader::read_to_end_into,NsReader::read_to_end_into_asyncandNsReader::read_text.The scope started by a start element was not ended after that call.
.read_text()when it is called after readingTextorGeneralRefevent.v0.39.0Compare Source
Added a way to configure
Writer. Now all configuration is contained in thewriter::Configstruct and can be applied at once. When
serde-typesfeature is enabled, configuration is serializable.New Features
config()andconfig_mut()to inspect and change the writer configuration./>in self-closed tags for maximum compatibility withXHTML.
empty_element_handling()as a more powerful alternative toexpand_empty_elements()in
Serializer.impl_deserialize_for_internally_tagged_enum!macrowhich is required if you enum variants contains
$valuefields.Bug Fixes
Misc Changes
serdeversion from 1.0.139 to 1.0.180..prefixes(),.resolve(),.resolve_attribute(), and.resolve_element()of
NsReader. Use.resolver().bindings()and.resolver().resolve()methods instead.Attributes::has_nilnow acceptsNamespaceResolverinstead ofReader<R>.SyntaxError::UnclosedPIOrXmlDeclintoUnclosedPIandUnclosedXmlDeclfor more precise error reporting.Parser::eof_errornow takes&selfand content&[u8]parameters.SyntaxError::UnclosedTagintoUnclosedTag,UnclosedSingleQuotedAttributeValueandUnclosedDoubleQuotedAttributeValuefor more precise error reporting.v0.38.4Compare Source
New Features
Serializer.Everywhere where the text node may be created, a CDATA section(s) could be produced instead.
See the new
Serializer::text_format()method.Bug Fixes
<int> 42 </int>. That space characters are usually indent added during serialization andother XML serialization libraries trims them
Misc Changes
Serializerv0.38.3Compare Source
Bug Fixes
\rXEOL sequences whereXis a char which isUTF-8 encoded as [c2 xx], except [c2 85].
Misc Changes
xml10_content()andxml11_content()methods which behaves the same ashtml_content()andxml_content()methods, but express intention more clearly.v0.38.2Compare Source
New Features
FusedIteratorforNamespaceBindingsIter.NamespaceResolverpublic.NsReader::resolver()for access to namespace resolver.Misc Changes
PrefixItertoNamespaceBindingsIter.v0.38.1Compare Source
Important changes
To get text in events according to the XML specification (normalized EOLs) use the
new methods
xml_content()instead ofdecode().Deserializeruses new methodautomatically.
New Features
Deserializerfrom existingNsReader:Deserializer::borrowingDeserializer::borrowing_with_resolverDeserializer::bufferingDeserializer::buffering_with_resolver$valuefields. The struct name willbe used as a tag name. Previously only enums was allowed there.
BytesText::xml_content,BytesCData::xml_contentandBytesRef::xml_contentmethods which returns XML EOL normalized strings.
BytesText::html_content,BytesCData::html_contentandBytesRef::html_contentmethods which returns HTML EOL normalized strings.
Bug Fixes
Deserializer.list of values and attribute requires decoding.
v0.38.0Compare Source
Significant changes
Now references to entities (as predefined, such as
<, as user-defined) reported as a newEvent::GeneralRef.Caller can parse the content of the entity and stream events from it as it is required by the
XML specification. See the updated
custom_entitiesexample!Implement whitespace behavior in the standard in
Deserializer, which says string primitivetypes should preserve whitespace, while all other primitives have collapse behavior.
New Features
Attributes::into_map_access(&str)andAttributes::into_deserializer()whenserializefeature is enabled. This will allow do deserialize serde types right from attributes. Both methods
returns the same type which implements serde's
DeserializerandMapAccesstraits.Event::GeneralRefwith content of general entity.allow_dangling_ampwhich allows to havea
¬ followed by;in the textual data which is required for some applicationsfor compatibility reasons.
quick_xml::de::Textto access text with trimmed spacesBug Fixes
$textand$valuespecial fields in one struct. Previouslyany text will be recognized as
$valuefield even when$textfield is also presented.xmlprefix from the attributes when map them to struct fields inDeserializer.Misc Changes
From<QName<'a>> for BytesStart<'a>because nowBytesStartstores theencoding in which its data is encoded, but
QNameis a simple wrapper around byte slice.BytesText::unescapeandBytesText::unescape_withreplaced byBytesText::decode.Now Text events does not contain escaped parts which are reported as
Event::GeneralRef.v0.37.5Compare Source
New Features
BytesCData::decode().v0.37.4Compare Source
Misc Changes
Debugimpl forNsReaderandReaderandCloneimpl forNsReaderv0.37.3Compare Source
New Features
Attribute::as_bool()method to get an attribute value as a boolean.Attributes::has_nil()method to check if attributes hasxsi:nilattribute set totrue.xsi:nilattribute in serde Deserializer to better process optional fields.v0.37.2Compare Source
New Features
se::to_utf8_io_writer()helper compatible withstd::io::Writeand restricted to UTF-8 encoding.v0.37.1Compare Source
New Features
BytesCData::escaped()fn to construct CDATA events from arbitrary user input.v0.37.0Compare Source
New Features
From<String>andFrom<Cow<str>>forquick_xml::de::Text.SimpleTypeDeserializerandSimpleTypeSerializerpublic.IntoDeserializerfor&mut Deserializer.Bug Fixes
$textfields and those$valuefieldsthat are serialized as a text (for example,
usizeorString).which is only
"true","1","false", and"0". Previously the following valuesalso was accepted:
booltrue"True","TRUE","t","Yes","YES","yes","y"false"False","FALSE","f","No","NO","no","n"Misc Changes
SeErrorfromDeErrorin theserializefeature.Serialize functions and methods now return
SeError.std::io::ErrorfromWritermethods.NamespaceErrorandEncodingErrorfromError.Error::EscapeErrortoError::Escapeto match other variants.Errorwhere only one variant is ever returned:attribute related methods on
BytesStartandBytesDeclreturnsAttrErrorSerializerby returning an enumeration with kind of written dataVec<usize>orVec<String>in$valuefields. They cannot be deserialized back with the same resultescapeand it variants take aimpl Into<Cow<str>>argument and implementFrom<(&'a str, Cow<'a, str>)>onAttributeDeError::InvalidInt,DeError::InvalidFloatandDeError::InvalidBoolean.Now the responsibility for returning the error lies with the visitor of the type.
See rationale in serde-rs/serde#2811
v0.36.2Compare Source
Bug Fixes
v0.36.1Compare Source
New Features
Reader::stream()that can be used to read arbitrary datafrom the inner reader while track position for XML reader.
v0.36.0Compare Source
Bug Fixes
<![CDATA[can start it.Previously any case was allowed.
.error_position()when encountering syntax error for open or self-closed tag.Misc Changes
reader::Parser,reader::ElementParserandreader::PiParsermoved to the new moduleparser.v0.35.0Compare Source
New Features
reader::Config::allow_unmatched_endsto permit dangling end tagsBug Fixes
Reader::read_to_endfamilyof methods and trimming of the trailing spaces in
Reader::read_textwhentrim_text_startis set and the last event is not aTextevent.As a result, the following variants of
quick_xml::escape::EscapeErrorare removed:TooLongDecimalTooLongHexadecimalAttribute::unescape_valuewhich does not unescape predefined values since 0.32.0.Textevent may be skipped inread_event_into()and
read_event_into_async()in some circumstances.Misc Changes
EscapeError::UnrecognizedSymbolrenamed toEscapeError::UnrecognizedEntity.PartialEqforEscapeError.EscapeErrorbyInvalidCharRefvariantwith a new
ParseCharRefErrorinside:EntityWithNullInvalidDecimalInvalidHexadecimalInvalidCodepointv0.34.0Compare Source
Bug Fixes
Reader<impl BufRead>readers.Misc Changes
Attribute::decode_and_unescape_valueandAttribute::decode_and_unescape_value_withnowaccepts
Decoderinstead ofReader. UseReader::decoder()to get it.Writer::write_eventnow consumes event. UseEvent::borrow()if you want to keep ownership.Reader::error_position()andReader::buffer_position()changed fromusizetou64.Spanchanged fromRange<usize>toRange<u64>.v0.33.0Compare Source
New Features
From<QName>forBytesStartandBytesEnd.Bug Fixes
trim_text_start = falseandtrim_text_end = true.Misc Changes
Event::PIto a new dedicatedBytesPItype.constas much functions as possible:resolve_html5_entity()resolve_predefined_entity()resolve_xml_entity()Attr::key()Attr::value()Attributes::html()Attributes::new()BytesDecl::from_start()Decoder::encoding()Deserializer::get_ref()IoReader::get_ref()LocalName::into_inner()Namespace::into_inner()NsReader::config()NsReader::prefixes()Prefix::into_inner()QName::into_inner()Reader::buffer_position()Reader::config()Reader::decoder()Reader::error_position()Reader::get_ref()SliceReader::get_ref()Writer::get_ref()Writer::new()quick_xml::escape::resolve_html5_entityunderescape-htmlfeature again.This function has significant influence to the compilation time (10+ seconds or 5x times)
v0.32.0Compare Source
The way to configure parser is changed. Now all configuration is contained in the
Configstruct and can be applied at once. Whenserde-typesfeature is enabled,configuration is serializable.
The method of reporting positions of errors has changed - use
error_position()to get an offset of the error position. For
SyntaxErrors the rangeerror_position()..buffer_position()also will represent a span of error.The way of resolve entities with
unescape_withare changed. Those methods no longerresolve predefined entities.
New Features
Error::IllFormed.config()andconfig_mut()to inspect and change the parserconfiguration. Previous builder methods on
Reader/NsReaderwas replaced bydirect access to fields of config using
reader.config_mut().<...>.Config::enable_all_checksto turn on or off allwell-formedness checks.
escape::minimal_escape()which escapes only&and<.BytesCData::minimal_escape()which escapes only&and<.Serializer::set_quote_level()which allow to set desired level of escaping.NsReader::prefixes()to list all the prefixes currently declared.impl_deserialize_for_internally_tagged_enummacro so thatit can handle every attribute that does not match existing cases within an enum variant.
Writer::create_element. This is breaking change!ElementWriter::new_line()which enables pretty printing elements with multiple attributes.Deserializer::get_ref()to get XML Reader from serde Deserializerquick_xml::escape::resolve_predefined_entityquick_xml::escape::resolve_xml_entityquick_xml::escape::resolve_html5_entityquick_xml::reader::PiParser.quick_xml::reader::ElementParser.Bug Fixes
<.Error::IllFormed(DoubleHyphenInComment).Error::IllFormed(MissingDoctypeName).expand_empty_elementsis set to true.Misc Changes
quick_xml::Errortype to provide more accurate information:Error::EndEventMismatchreplaced byIllFormedError::MismatchedEndTagin some casesError::EndEventMismatchreplaced byIllFormedError::UnmatchedEndTagin some casesError::TextNotFoundwas removed because not usedError::UnexpectedBangreplaced bySyntaxErrorError::UnexpectedEofreplaced bySyntaxErrorin some casesError::UnexpectedEofreplaced byIllFormedErrorin some casesError::UnexpectedTokenreplaced byIllFormedError::DoubleHyphenInCommentError::XmlDeclWithoutVersionreplaced byIllFormedError::MissingDeclVersion(in #684)Error::EmptyDocTypereplaced byIllFormedError::MissingDoctypeName(in #684)SyntaxErrors: now they are always pointsto the start of markup (i. e. to the
<character) with error. Useerror_position()for that.
<??>parsed asEvent::PIwith empty content instead of raisingsyntax error.
<?xml?>parsed asEvent::Declinstead ofEvent::PI.QuoteLevel::Partialwhen using serde serializer.buffer_position()now always report the position the parser last seen.To get an error position use
error_position().intermediate custom deserializer.
CloneforDeEvent,PayloadEventandText.NoEntityResolvertoPredefinedEntityResolver.lt,gt,apos,quot,amp)in
unescape_withfamily of methods. You should do that by yourself using the methodslisted above.
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
bc458bc266toe9be963d13View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.