Releases: tafia/quick-xml
Serde helpers and indentation for async writer
What's Changed
New Features
- #601: Add
serde_helpermodule to the crate root with some useful utility
functions and document using of enum's unit variants as a text content of element. - #606: Implement indentation for
AsyncWritetrait implementations.
Bug Fixes
- #603: Fix a regression from #581 that an XML comment or a processing
instruction between a <!DOCTYPE> and the root element in the file brokes
deserialization of structs by returningDeError::ExpectedStart - #608: Return a new error
Error::EmptyDocTypeon empty doctype instead
of crashing because of a debug assertion.
Misc Changes
- #594: Add a helper macro to help deserialize internally tagged enums
with Serde, which doesn't work out-of-box due to serde limitations.
New Contributors
- @damb made their first contribution in #606
- @danjpgriffin made their first contribution in #603
- @Kriskras99 made their first contribution in #594
Full Changelog: v0.28.2...v0.29.0
EntityResolver for deserializer and export EscapeError
What's Changed
New Features
- #581: Allow
Deserializerto setquick_xml::de::EntityResolverfor resolving unknown entities that would otherwise cause the parser to return an [EscapeError::UnrecognizedSymbol] error.
Misc Changes
- #584: Export
EscapeErrorfrom the crate - #581: Relax requirements for
unsescape_*set of functions -- their now useFnMutinstead ofFnforresolve_entityparameters, likeIterator::mapfromstd.
New Contributors
- @Aaron1011 made their first contribution in #584
- @pigeonhands made their first contribution in #583
Full Changelog: v0.28.1...v0.28.2
Relax requirements in `ElementWriter.write_inner_content`
What's Changed
Misc Changes
- #579:
ElementWriter.write_inner_contentnow uses aFnOnceinstead of a more restrictiveFnclosure
New Contributors
Full Changelog: v0.28.0...v0.28.1
Improvements in serde and async
What's Changed
New Features
- #541: (De)serialize specially named
$textenum variant in externally tagged
enums to / from textual content - #556:
to_writerandto_stringnow accept?Sizedtypes - #556: Add new
to_writer_with_rootandto_string_with_roothelper functions - #520: Add methods
BytesText::inplace_trim_startandBytesText::inplace_trim_end
to trim leading and trailing spaces from text events - #565: Allow deserialize special field names
$valueand$textinto borrowed
fields when use serde deserializer - #568: Rename
Writter::innerintoWritter::get_mut - #568: Add method
Writter::get_ref - #569: Rewrite the
Reader::read_event_into_asyncas an async fn, making the futureSendif possible. - #571: Borrow element names (
<element>) when deserialize with serde.
This change allow to deserialize intoHashMap<&str, T>, for example - #573: Add basic support for async byte writers via tokio's
AsyncWrite.
Bug Fixes
- #537: Restore ability to deserialize attributes that represents XML namespace
mappings (xmlns:xxx) that was broken since #490 - #510: Fix an error of deserialization of
Option<T>fields whereTis some
sequence type (for example,Vecor tuple) - #540: Fix a compilation error (probably a rustc bug) in some circumstances.
Serializer::newandSerializer::with_rootnow accepts only references toWriter. - #520: Merge consequent (delimited only by comments and processing instructions)
texts and CDATA when deserialize using serde deserializer.DeEvent::Textand
DeEvent::CDataevents was replaced byDeEvent::Textwith merged content.
The same behavior for theReaderdoes not implemented (yet?) and should be
implemented manually - #562: Correctly set minimum required version of memchr dependency to 2.1
- #565: Correctly set minimum required version of tokio dependency to 1.10
- #565: Fix compilation error when build with serde <1.0.139
New Contributors
- @emarsden made their first contribution in #535
- @dacut made their first contribution in #494
- @silvergasp made their first contribution in #554
- @dburgener made their first contribution in #562
- @martsokha made their first contribution in #568
- @vilunov made their first contribution in #569
Full Changelog: v0.27.1...v0.28.0
Fix an infinite loop in some circumstates
What's Changed
Bug Fixes
- #530: Fix an infinite loop leading to unbounded memory consumption that occurs when
skipping events on malformed XML with theoverlapped-listsfeature active. - #530: Fix an error in the
Deserializer::read_to_endwhenoverlapped-lists
feature is active and malformed XML is parsed
Full Changelog: v0.27.0...v0.27.1
Improvements in serde deserializer and MSRV bumped to 1.52
What's Changed
MSRV was increased from 1.46 to 1.52 in #521.
New Features
- #521: Implement
Clonefor all error types. This required changingError::Ioto contain
Arc<std::io::Error>instead ofstd::io::Errorsincestd::io::Errordoes not implement
Clone.
Bug Fixes
- #490: Ensure that serialization of map keys always produces valid XML names.
In particular, that means that maps with numeric and numeric-like keys (for
example,"42") no longer can be serialized because XML name cannot start
from a digit - #500: Fix deserialization of top-level sequences of enums, like
<?xml version="1.0" encoding="UTF-8"?> <!-- list of enum Enum { A, B, С } --> <A/> <B/> <C/>
- #514: Fix wrong reporting
Error::EndEventMismatchafter disabling and enabling
.check_end_names - #517: Fix swapped codes for
\rand\ncharacters when escaping them - #523: Fix incorrect skipping text and CDATA content before any map-like structures
in serde deserializer, likeunwanted text<struct>...</struct>
- #523: Fix incorrect handling of
xs:lists with encoded spaces: they still
act as delimiters, which is confirmed also by mature XmlBeans Java library - #473: Fix a hidden requirement to enable serde's
derivefeature to get
quick-xml'sserializefeature foredition = 2021orresolver = 2crates
Misc Changes
-
#490: Removed
$unflatten=special prefix for fields for serde (de)serializer, because:- it is useless for deserializer
- serializer was rewritten and does not require it anymore
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 struct
field 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
$valuespecial name for a field a new$text
special name was added:$textis used if you want to map field to text content only. No markup is
expected (but text can represent a list as defined byxs:listtype)$valueis used if you want to map elements with different names to one field,
that should be represented either by anenum, or by sequence ofenums
(Vec, tuple, etc.), or by string. Use it when you want to map field to any
content of the field, text or markup
Refer to documentation for details.
-
#521: MSRV bumped to 1.52.
-
#473:
serdefeature that used to make some types serializable, renamed toserde-types -
#528: Added documentation for XML to
serdemapping
New Contributors
- @sashka made their first contribution in #498
- @ultrasaurus made their first contribution in #504
- @zeenix made their first contribution in #521
Full Changelog: v0.26.0...v0.27.0