fix(deps): update rust crate quick-xml to 0.37 #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.22
->0.37
Release Notes
tafia/quick-xml (quick-xml)
v0.37.0
Compare Source
New Features
From<String>
andFrom<Cow<str>>
forquick_xml::de::Text
.SimpleTypeDeserializer
andSimpleTypeSerializer
public.IntoDeserializer
for&mut Deserializer
.Bug Fixes
$text
fields and those$value
fieldsthat are serialized as a text (for example,
usize
orString
).which is only
"true"
,"1"
,"false"
, and"0"
. Previously the following valuesalso was accepted:
bool
true
"True"
,"TRUE"
,"t"
,"Yes"
,"YES"
,"yes"
,"y"
false
"False"
,"FALSE"
,"f"
,"No"
,"NO"
,"no"
,"n"
Misc Changes
SeError
fromDeError
in theserialize
feature.Serialize functions and methods now return
SeError
.std::io::Error
fromWriter
methods.NamespaceError
andEncodingError
fromError
.Error::EscapeError
toError::Escape
to match other variants.Error
where only one variant is ever returned:attribute related methods on
BytesStart
andBytesDecl
returnsAttrError
Serializer
by returning an enumeration with kind of written dataVec<usize>
orVec<String>
in$value
fields. They cannot be deserialized back with the same resultescape
and it variants take aimpl Into<Cow<str>>
argument and implementFrom<(&'a str, Cow<'a, str>)>
onAttribute
DeError::InvalidInt
,DeError::InvalidFloat
andDeError::InvalidBoolean
.Now the responsibility for returning the error lies with the visitor of the type.
See ratiohttps://github.com/serde-rs/serde/pull/2811ull/2811
v0.36.2
Compare Source
Bug Fixes
v0.36.1
Compare Source
New Features
Reader::stream()
that can be used to read arbitrary datafrom the inner reader while track position for XML reader.
v0.36.0
Compare 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::ElementParser
andreader::PiParser
moved to the new moduleparser
.v0.35.0
Compare Source
New Features
reader::Config::allow_unmatched_ends
to permit dangling end tagsBug Fixes
Reader::read_to_end
familyof methods and trimming of the trailing spaces in
Reader::read_text
whentrim_text_start
is set and the last event is not aText
event.As a result, the following variants of
quick_xml::escape::EscapeError
are removed:TooLongDecimal
TooLongHexadecimal
Attribute::unescape_value
which does not unescape predefined values since 0.32.0.Text
event may be skipped inread_event_into()
and
read_event_into_async()
in some circumstances.Misc Changes
EscapeError::UnrecognizedSymbol
renamed toEscapeError::UnrecognizedEntity
.PartialEq
forEscapeError
.EscapeError
byInvalidCharRef
variantwith a new
ParseCharRefError
inside:EntityWithNull
InvalidDecimal
InvalidHexadecimal
InvalidCodepoint
v0.34.0
Compare Source
Bug Fixes
Reader<impl BufRead>
readers.Misc Changes
Attribute::decode_and_unescape_value
andAttribute::decode_and_unescape_value_with
nowaccepts
Decoder
instead ofReader
. UseReader::decoder()
to get it.Writer::write_event
now consumes event. UseEvent::borrow()
if you want to keep ownership.Reader::error_position()
andReader::buffer_position()
changed fromusize
tou64
.Span
changed fromRange<usize>
toRange<u64>
.v0.33.0
Compare Source
New Features
From<QName>
forBytesStart
andBytesEnd
.Bug Fixes
trim_text_start = false
andtrim_text_end = true
.Misc Changes
Event::PI
to a new dedicatedBytesPI
type.const
as 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_entity
underescape-html
feature again.This function has significant influence to the compilation time (10+ seconds or 5x times)
v0.32.0
Compare Source
The way to configure parser is changed. Now all configuration is contained in the
Config
struct and can be applied at once. Whenserde-types
feature 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
SyntaxError
s the rangeerror_position()..buffer_position()
also will represent a span of error.The way of resolve entities with
unescape_with
are 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
/NsReader
was replaced bydirect access to fields of config using
reader.config_mut().<...>
.Config::enable_all_checks
to 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_enum
macro 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_entity
quick_xml::escape::resolve_xml_entity
quick_xml::escape::resolve_html5_entity
quick_xml::reader::PiParser
.quick_xml::reader::ElementParser
.Bug Fixes
<
.Error::IllFormed(DoubleHyphenInComment)
.Error::IllFormed(MissingDoctypeName)
.expand_empty_elements
is set to true.Misc Changes
quick_xml::Error
type to provide more accurate information:Error::EndEventMismatch
replaced byIllFormedError::MismatchedEndTag
in some casesError::EndEventMismatch
replaced byIllFormedError::UnmatchedEndTag
in some casesError::TextNotFound
was removed because not usedError::UnexpectedBang
replaced bySyntaxError
Error::UnexpectedEof
replaced bySyntaxError
in some casesError::UnexpectedEof
replaced byIllFormedError
in some casesError::UnexpectedToken
replaced byIllFormedError::DoubleHyphenInComment
Error::XmlDeclWithoutVersion
replaced byIllFormedError::MissingDeclVersion
(in #684)Error::EmptyDocType
replaced byIllFormedError::MissingDoctypeName
(in #684)SyntaxError
s: now they are always pointsto the start of markup (i. e. to the
<
character) with error. Useerror_position()
for that.
<??>
parsed asEvent::PI
with empty content instead of raisingsyntax error.
<?xml?>
parsed asEvent::Decl
instead ofEvent::PI
.QuoteLevel::Partial
when 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.
Clone
for [DeEvent
][DeEvent], [PayloadEvent
][PayloadEvent] and [Text
][Text].NoEntityResolver
toPredefinedEntityResolver
.lt
,gt
,apos
,quot
,amp
)in
unescape_with
family of methods. You should do that by yourself using the methodslisted above.
v0.31.0
Compare Source
MSRV bumped to 1.56! Crate now uses Rust 2021 edition.
Enum representation was changed (it was buggy anyway) to ensure compatibility with
serde >= 1.0.181
New Features
xml
andxmlns
) to their appropriate URIs.Also, enforce namespace constraints related to these well-known namespaces.
ElementWriter
operations.Bug Fixes
xs:list
s from empty tags (<tag/>
or
<tag></tag>
). Previously anDeError::UnexpectedEof")
was returned in that caseunit structs, unit variants).
<int>123<something-else/></int>
is no longer validcontent. Previously all data after
123
up to closing tag would be silently skipped.simpleType
s (for example, attributes) intoOption
fields: now they are always deserialized asSome("")
.Misc Changes
Error
variant --Error::InvalidPrefixBind
.arbitrary
dependency -- we're actuallycompatible with version 1.0.0 and up.
ElementWriter::write_inner_content
(and newly added
ElementWriter::write_inner_content_async
of course).xs:list
s when some elements serialized to an empty string.v0.30.0
Compare Source
New Features
Writer::write_serializable
to provide the capability to serializearbitrary types using serde when using the lower-level
Writer
API.Bug Fixes
<!-->
when usingread_event_into*
functions.Misc Changes
v0.29.0
Compare Source
New Features
serde_helper
module to the crate root with some useful utilityfunctions and document using of enum's unit variants as a text content of element.
AsyncWrite
trait implementations.Bug Fixes
instruction between a <!DOCTYPE> and the root element in the file broke
deserialization of structs by returning
DeError::ExpectedStart
Error::EmptyDocType
on empty doctype insteadof crashing because of a debug assertion.
Misc Changes
with Serde, which doesn't work out-of-the-box due to serde limitations.
v0.28.2
Compare Source
New Features
Deserializer
to setquick_xml::de::EntityResolver
forresolving unknown entities that would otherwise cause the parser to return
an [
EscapeError::UnrecognizedSymbol
] error.Misc Changes
EscapeError
from the crateunsescape_*
set of functions -- their now useFnMut
instead ofFn
forresolve_entity
parameters, likeIterator::map
from
std
.v0.28.1
Compare Source
Misc Changes
ElementWriter.write_inner_content
now uses aFnOnce
instead of a more restrictiveFn
closurev0.28.0
Compare Source
New Features
$text
enum variant in externally taggedenums to / from textual content
to_writer
andto_string
now accept?Sized
typesto_writer_with_root
andto_string_with_root
helper functionsBytesText::inplace_trim_start
andBytesText::inplace_trim_end
to trim leading and trailing spaces from text events
$value
and$text
into borrowedfields when use serde deserializer
Writer::inner
intoWriter::get_mut
Writer::get_ref
Reader::read_event_into_async
as an async fn, making the futureSend
if possible.<element>
) when deserialize with serde.This change allow to deserialize into
HashMap<&str, T>
, for exampleAsyncWrite
.Bug Fixes
mappings (
xmlns:xxx
) that was broken since #490Option<T>
fields whereT
is somesequence type (for example,
Vec
or tuple)Serializer::new
andSerializer::with_root
now accepts only references toWrite
r.texts and CDATA when deserialize using serde deserializer.
DeEvent::Text
andDeEvent::CData
events was replaced byDeEvent::Text
with merged content.The same behavior for the
Reader
does not implemented (yet?) and should beimplemented manually
v0.27.1
Compare Source
Bug Fixes
skipping events on malformed XML with the
overlapped-lists
feature active.Deserializer::read_to_end
whenoverlapped-lists
feature is active and malformed XML is parsed
v0.27.0
Compare Source
New Features
Clone
for all error types. This required changingError::Io
to containArc<std::io::Error>
instead ofstd::io::Error
sincestd::io::Error
does not implementClone
.Bug Fixes
In particular, that means that maps with numeric and numeric-like keys (for
example,
"42"
) no longer can be serialized because XML name cannot startfrom a digit
Error::EndEventMismatch
after disabling and enabling.check_end_names
\r
and\n
characters when escaping themin serde deserializer, like
xs:list
s with encoded spaces: they stillact as delimiters, which is confirmed also by mature XmlBeans Java library
derive
feature to getquick-xml's
serialize
feature foredition = 2021
orresolver = 2
cratesMisc Changes
#490: Removed
$unflatten=
special prefix for fields for serde (de)serializer, because:This prefix allowed you to serialize struct field as an XML element and now
replaced by a more thoughtful system explicitly indicating that a field should
be serialized as an attribute by prepending
@
character to its name#490: Removed
$primitive=
prefix. That prefix allowed you to serialize structfield as an attribute instead of an element and now replaced by a more thoughtful
system explicitly indicating that a field should be serialized as an attribute
by prepending
@
character to its name#490: In addition to the
$value
special name for a field a new$text
special name was added:
$text
is used if you want to map field to text content only. No markup isexpected (but text can represent a list as defined by
xs:list
type)$value
is used if you want to map elements with different names to one field,that should be represented either by an
enum
, or by sequence ofenum
s(
Vec
, tuple, etc.), or by string. Use it when you want to map field to anycontent of the field, text or markup
Refer to documentation for details.
#521: MSRV bumped to 1.52.
#473:
serde
feature that used to make some types serializable, renamed toserde-types
#528: Added documentation for XML to
serde
mappingv0.26.0
Compare Source
Misc Changes
const fn
added in version 0.24 in favor of a lower minimumsupported Rust version (1.46.0). Minimum supported Rust version is now verified in the CI.
tests, examples, and benchmarks.
v0.25.0
Compare Source
Bug Fixes
Misc Changes
DeError::Unsupported
changed from&'static str
toCow<'static, str>
v0.24.1
Compare Source
Bug Fixes
v0.24.0
Compare Source
New Features
(using new feature
overlapped-lists
)name
withQName
,LocalName
,Namespace
,Prefix
and
PrefixDeclaration
wrappers around byte arrays andResolveResult
withthe result of namespace resolution
Decoder
struct public. You already had access to it via theReader::decoder()
method, but could not name it in the code. Now the preferredway to access decoding functionality is via this struct
xs:list
Reader::from_str
/Deserializer::from_str
/from_str
now ignorethe XML declared encoding and always use UTF-8
borrow()
methods in all event structs which allows to geta borrowed version of any event
NsReader
, namely:Reader
NsReader
read_event
-- borrow from inputread_resolved_event
-- borrow from inputread_event_into
read_namespaced_event
read_resolved_event_into
resolve
event_namespace
resolve_element
attribute_namespace
resolve_attribute
detect_encoding()
anddecode()
under thequick-xml::encoding
namespace.read_to_end*
methods to return a span between tagsReader::read_text
method to return a raw content (including markup) between tagsWriter::write_bom()
method for inserting a Byte-Order-Mark into the document.const
:Attr::key
Attr::value
Attributes::html
Attributes::new
BytesDecl::from_start
Decoder::encoding
LocalName::into_inner
Namespace::into_inner
Prefix::into_inner
QName::into_inner
Reader::buffer_position
Reader::decoder
Reader::get_ref
Serializer::new
Serializer::with_root
Writer::new
Bug Fixes
This broke deserialization of untagged enums which rely on error if variant cannot be parsed
$value
fielda sequence field (such as
Vec<T>
), where elements of this sequence containsanother sequence. This error affects only users with the
serialize
feature enabledevent_namespace
,attribute_namespace
andread_event_namespaced
returns
ResolveResult::Unknown
if prefix was not registered in namespace bufferEvent::Text
eventsread_to_end
family of methods orread_text
method not found a corresponding end tag and reader has non-UTF-8 encoding
decoding should be first, unescape is the second
when an enum variant represented as a
Text
event (i.e.<xml>tag</xml>
)and a document encoding is not an UTF-8
in a serde deserializer
Misc Changes
#8: Changes in the error type
DeError
:DeError::Text
DeError::InvalidEnum
DeError::Xml
DeError::InvalidXml
for consistency withDeError::InvalidBoolean
DeError::Int
DeError::InvalidInt
for consistency withDeError::InvalidBoolean
DeError::Float
DeError::InvalidFloat
for consistency withDeError::InvalidBoolean
DeError::Start
DeError::UnexpectedStart
and tag name added to an errorDeError::End
DeError::UnexpectedEnd
and tag name added to an errorDeEvent::Eof
DeError::UnexpectedEof
DeError::EndOfAttributes
DeError::KeyNotFound
DeError::ExpectedStart
#391: Added code coverage
#393:
event_namespace
andattribute_namespace
now acceptQName
and returns
ResolveResult
andLocalName
,read_event_namespaced
nowreturns
ResolveResult
instead ofOption<[u8]>
#393: Types of
Attribute::key
andAttr::key()
changed toQName
#393: Now
BytesStart::name()
andBytesEnd::name()
returnsQName
, andBytesStart::local_name()
andBytesEnd::local_name()
returnsLocalName
#191: Remove unused
reader.decoder().decode_owned()
. If you ever used it,use
String::from_utf8
instead (which that function did)#191: Remove
*_without_bom
methods from theAttributes
struct because they are useless.Use the same-named methods without that suffix instead. Attribute values cannot contain BOM
#191: Remove
Reader::decode()
andReader::decode_without_bom()
, they are replaced byDecoder::decode()
and nothing.Use
reader.decoder().decode_*(...)
instead ofreader.decode_*(...)
for now.Reader::encoding()
is replaced byDecoder::encoding()
as well#180: Eliminated the differences in the decoding API when feature
encoding
enabled and when it isdisabled. Signatures of functions are now the same regardless of whether or not the feature is
enabled, and an error will be returned instead of performing replacements for invalid characters
in both cases.
Previously, if the
encoding
feature was enabled, decoding functions would returnResult<Cow<&str>>
while without this feature they would return
Result<&str>
. With this change, onlyResult<Cow<&str>>
is returned regardless of the status of the feature.
#180: Error variant
Error::Utf8
replaced byError::NonDecodable
#118: Remove
BytesStart::unescaped*
set of methods because they could return wrong resultsUse methods on
Attribute
instead#403: Remove deprecated
quick_xml::de::from_bytes
andDeserializer::from_borrowing_reader
#412: Rename methods of
Reader
:read_event
read_event_into
read_to_end
read_to_end_into
read_text
read_text_into
read_event_unbuffered
read_event
read_to_end_unbuffered
read_to_end
#412: Change
read_to_end*
andread_text_into
to acceptQName
instead ofAsRef<[u8]>
#415: Changed custom entity unescaping API to accept closures rather than a mapping of entity to
replacement text. This avoids needing to allocate a map and provides the user with more flexibility.
#415: Renamed functions for consistency across the API:
*_with_custom_entities
*_with
BytesText::unescaped()
BytesText::unescape()
Attribute::unescaped_*
Attribute::unescape_*
#329: Also, that functions now borrow from the input instead of event / attribute
#416:
BytesStart::to_borrowed
renamed toBytesStart::borrow
, the same methodadded to all events
#421:
decode_and_unescape*
methods now does one less allocation if unescaping is not required#421: Removed ability to deserialize byte arrays from serde deserializer.
XML is not able to store binary data directly, you should always use some encoding
scheme, for example, HEX or Base64
#421: All unescaping functions now accepts and returns strings instead of byte slices
#423: All escaping functions now accepts and returns strings instead of byte slices
#423: Removed
BytesText::from_plain
because it internally did escaping of a byte array,but since now escaping works on strings. Use
BytesText::new
instead#428: Removed
BytesText::escaped()
. Use.as_ref()
provided byDeref
impl instead.#428: Removed
BytesText::from_escaped()
. Use constructors from strings instead,because writer anyway works in UTF-8 only
#428: Removed
BytesCData::new()
. Use constructors from strings instead,because writer anyway works in UTF-8 only
#428: Changed the event and
Attributes
constructors to accept a&str
slices instead of&[u8]
slices.Handmade events has always been assumed to store their content UTF-8 encoded.
#428: Removed
Decoder
parameter from_and_decode
versions of functions forBytesText
(remember, that those functions was renamed in #415).#431: Changed event constructors:
BytesStart::owned_name(impl Into<Vec<u8>>)
BytesStart::new(impl Into<Cow<str>>)
BytesStart::borrowed_name(&[u8])
BytesStart::owned(impl Into<Vec<u8>>, usize)
BytesStart::from_content(impl Into<Cow<str>>, usize)
BytesStart::borrowed(&[u8], usize)
BytesEnd::owned(Vec<u8>)
BytesEnd::new(impl Into<Cow<str>>)
BytesEnd::borrowed(&[u8])
BytesText::from_escaped(impl Into<Cow<[u8]>>)
BytesText::from_escaped(impl Into<Cow<str>>)
BytesText::from_escaped_str(impl Into<Cow<str>>)
BytesText::from_plain(&[u8])
BytesText::new(&str)
BytesText::from_plain_str(&str)
BytesCData::new(impl Into<Cow<[u8]>>)
BytesCData::new(impl Into<Cow<str>>)
BytesCData::from_str(&str)
#440: Removed
Deserializer::from_slice
andquick_xml::de::from_slice
methods because deserializing from a bytearray cannot guarantee borrowing due to possible copying while decoding.
#455: Removed
Reader::read_text_into
which is just a thin wrapper over match onEvent::Text
#456: Reader and writer stuff grouped under
reader
andwriter
modules.You still can use re-exported definitions from a crate root
#459: Made the
Writer::write()
method non-public as writing random bytes to a document is not generally useful or desirable.#459: BOM bytes are no longer emitted as
Event::Text
. To write a BOM, useWriter::write_bom()
.#467: Removed
Deserializer::new
because it cannot be used outside of the quick-xml crateNew Tests
Reader::read_event_impl
to ensure that proper events generated for corresponding inputs/tests/documents
are checked out with LF eol in working copy (except sample_5_utf16bom.xml)v0.23.1
Compare Source
Bug Fixes
v0.23.0
Compare Source
i128
/u128
in attributes or text/CDATA contentunit
s from any data in attribute values and text nodesDeserializer::from_str
,Deserializer::from_slice
andDeserializer::from_reader
from_bytes
andDeserializer::from_borrowing_reader
becausethey are fully equivalent to
from_slice
andDeserializer::new
from the attribute and element names and attribute values
unit
s from text and CDATA content.DeError::InvalidUnit
variant is removed, because after fix it is no longer usedElementWriter
, introduced in #274(0.23.0-alpha2) now available to end users
<!doctype >
definition (used in HTML 5) when parse document from&[u8]
Error::UnexpectedBang
now provide the byte found(#344)
<root>...</root>
-- one tag with content)CDATA event data now represented by its own
BytesCData
type(quick-xml#311)
Reader::get_ref()
andReader::get_mut()
, renameReader::into_underlying_reader()
toReader::into_inner()
Attributes::next()
returns a new typeAttrError
when attribute parsing failed(#4)
FusedIterator
(#4)attributes()
or
html_attributes()
(#4)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.