Releases: tafia/quick-xml
v0.38.3 - Fix EOL normalization in some cases
What's Changed
Bug Fixes
- #895: Fix incorrect normalization of
\rX
EOL sequences whereX
is a char which is UTF-8 encoded as [c2 xx], except [c2 85].
Misc Changes
- #895: Add new
xml10_content()
andxml11_content()
methods which behaves the same ashtml_content()
andxml_content()
methods, but express intention more clearly.
Full Changelog: v0.38.2...v0.38.3
v0.38.2 - Make NamespaceResolver public
What's Changed
New Features
- #893: Implement
FusedIterator
forNamespaceBindingsIter
. - #893: Make
NamespaceResolver
public. - #893: Add
NsReader::resolver()
for access to namespace resolver.
Misc Changes
- #893: Rename
PrefixIter
toNamespaceBindingsIter
.
New Contributors
- @decathorpe made their first contribution in #891
Full Changelog: v0.38.1...v0.38.2
v0.38.1 - EOL normalization in events
What's Changed
Important changes
To get text in events according to the XML specification (normalized EOLs) use the new methods xml_content()
instead of decode()
. Deserializer
uses new method automatically.
New Features
- #882: Add new methods to create
Deserializer
from existingNsReader
:Deserializer::borrowing
Deserializer::borrowing_with_resolver
Deserializer::buffering
Deserializer::buffering_with_resolver
- #878: Add ability to serialize structs in
$value
fields. The struct name will be used as a tag name. Previously only enums was allowed there. - #806: Add
BytesText::xml_content
,BytesCData::xml_content
andBytesRef::xml_content
methods which returns XML EOL normalized strings. - #806: Add
BytesText::html_content
,BytesCData::html_content
andBytesRef::html_content
methods which returns HTML EOL normalized strings.
Bug Fixes
- #806: Properly normalize EOL characters in
Deserializer
. - #888: Properly split attribute values by items when deserialize attribute into list of values and attribute requires decoding.
New Contributors
- @fukusuket made their first contribution in #874
- @xdm67x made their first contribution in #882
Full Changelog: v0.38.0...v0.38.1
v0.38.0 - Better support of references (&...;)
What's Changed
Significant changes
Now references to entities (as predefined, such as <
, as user-defined) reported as a new Event::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_entities
example!
Implement whitespace behavior in the standard in Deserializer
, which says string primitive types should preserve whitespace, while all other primitives have collapse behavior.
New Features
- #863: Add
Attributes::into_map_access(&str)
andAttributes::into_deserializer()
whenserialize
feature is enabled. This will allow do deserialize serde types right from attributes. Both methods returns the same type which implements serde'sDeserializer
andMapAccess
traits. - #766: Allow to parse resolved entities as XML fragments and stream events from them.
- #766: Added new event
Event::GeneralRef
with content of general entity. - #766: Added new configuration option
allow_dangling_amp
which allows to have a&
not followed by;
in the textual data which is required for some applications for compatibility reasons. - #285: Add ability to
quick_xml::de::Text
to access text with trimmed spaces
Bug Fixes
- #868: Allow to have both
$text
and$value
special fields in one struct. Previously any text will be recognized as$value
field even when$text
field is also presented. - #868: Skip text events when deserialize a sequence of items overlapped with text (including CDATA).
- #841: Do not strip
xml
prefix from the attributes when map them to struct fields inDeserializer
.
Misc Changes
- #863: Remove
From<QName<'a>> for BytesStart<'a>
because nowBytesStart
stores the encoding in which its data is encoded, butQName
is a simple wrapper around byte slice. - #766:
BytesText::unescape
andBytesText::unescape_with
replaced byBytesText::decode
. Now Text events does not contain escaped parts which are reported asEvent::GeneralRef
.
New Contributors
- @Dr-Emann made their first contribution in #860
- @maxence-cornaton made their first contribution in #864
- @dizzyi made their first contribution in #866
- @eirnym made their first contribution in #870
- @ggodlewski made their first contribution in #865
- @curatorsigma made their first contribution in #873
Full Changelog: v0.37.5...v0.38.0
v0.37.5 - BytesCData::decode()
What's Changed
New Features
- #857: Add
BytesCData::decode()
.
New Contributors
- @mematthias made their first contribution in #857
Full Changelog: v0.37.4...v0.37.5
v0.37.4 - Derive more traits for readers
What's Changed
Misc Changes
- #852: Add
Debug
impl forNsReader
andReader
andClone
impl forNsReader
New Contributors
Full Changelog: v0.37.3...v0.37.4
v0.37.3 - support for `xsi:nil` in Deserializer
What's Changed
New Features
- #850: Add
Attribute::as_bool()
method to get an attribute value as a boolean. - #850: Add
Attributes::has_nil()
method to check if attributes hasxsi:nil
attribute set totrue
. - #497: Handle
xsi:nil
attribute in serde Deserializer to better process optional fields.
Full Changelog: v0.37.2...v0.37.3
v0.37.2 - se::to_utf8_io_writer()
What's Changed
New Features
- #836: Add
se::to_utf8_io_writer()
helper compatible withstd::io::Write
and restricted to UTF-8 encoding.
New Contributors
- @pronebird made their first contribution in #836
Full Changelog: v0.37.1...v0.37.2
v0.37.1 - Write CDATA safely
v0.37.0 - serde & errors imporvements
What's Changed
β οΈ Significant Changes
Those changes could require not trivial adoption of your code:
- The recognized boolean values in serde
Deserializer
are reduced. Use#[serde(deserialize_with)]
which will accept and parse strings if you need the old behavior. Serializer
no longer serialize consequent primitive values (those which would produce only text, without surrounding tags), because it is impossible to deserialize them back to the same value.- The crate's errors was changed, some variants was splitted to their own error types, some removed.
New Features
- #826: Implement
From<String>
andFrom<Cow<str>>
forquick_xml::de::Text
. - #826: Make
SimpleTypeDeserializer
andSimpleTypeSerializer
public. - #826: Implement
IntoDeserializer
for&mut Deserializer
.
Bug Fixes
- #655: Do not write indent before and after
$text
fields and those$value
fields that are serialized as a text (for example,usize
orString
). - #826: Handle only those boolean representations that are allowed by Xml Schema which is only
"true"
,"1"
,"false"
, and"0"
. Previously the following values also was accepted:bool
XML content true
"True"
,"TRUE"
,"t"
,"Yes"
,"YES"
,"yes"
,"y"
false
"False"
,"FALSE"
,"f"
,"No"
,"NO"
,"no"
,"n"
Misc Changes
- #227: Split
SeError
fromDeError
in theserialize
feature. Serialize functions and methods now returnSeError
. - #810: Return
std::io::Error
fromWriter
methods. - #811: Split
NamespaceError
andEncodingError
fromError
. - #811: Renamed
Error::EscapeError
toError::Escape
to match other variants. - #811: Narrow down error return type from
Error
where only one variant is ever returned: attribute related methods onBytesStart
andBytesDecl
returnsAttrError
. - #820: Classify output of the
Serializer
by returning an enumeration with kind of written data. - #823: Do not allow serialization of consequent primitives, for example
Vec<usize>
orVec<String>
in$value
fields. They cannot be deserialized back with the same result. - #827: Make
escape
and it variants take aimpl Into<Cow<str>>
argument and implementFrom<(&'a str, Cow<'a, str>)>
onAttribute
. - #826: Removed
DeError::InvalidInt
,DeError::InvalidFloat
andDeError::InvalidBoolean
. Now the responsibility for returning the error lies with the visitor of the type. See rationale in serde-rs/serde#2811
New Contributors
- @RedPhoenixQ made their first contribution in #810
Full Changelog: v0.36.2...v0.37.0