Skip to content

Releases: tafia/quick-xml

v0.38.3 - Fix EOL normalization in some cases

24 Aug 09:35
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • #895: Fix incorrect normalization of \rX EOL sequences where X is a char which is UTF-8 encoded as [c2 xx], except [c2 85].

Misc Changes

  • #895: Add new xml10_content() and xml11_content() methods which behaves the same as html_content() and xml_content() methods, but express intention more clearly.

Full Changelog: v0.38.2...v0.38.3

v0.38.2 - Make NamespaceResolver public

19 Aug 17:12
Compare
Choose a tag to compare

What's Changed

New Features

  • #893: Implement FusedIterator for NamespaceBindingsIter.
  • #893: Make NamespaceResolver public.
  • #893: Add NsReader::resolver() for access to namespace resolver.

Misc Changes

  • #893: Rename PrefixIter to NamespaceBindingsIter.

New Contributors

Full Changelog: v0.38.1...v0.38.2

v0.38.1 - EOL normalization in events

03 Aug 15:45
Compare
Choose a tag to compare

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 existing NsReader:
    • 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 and BytesRef::xml_content methods which returns XML EOL normalized strings.
  • #806: Add BytesText::html_content, BytesCData::html_content and BytesRef::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

Full Changelog: v0.38.0...v0.38.1

v0.38.0 - Better support of references (&...;)

28 Jun 21:02
Compare
Choose a tag to compare

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) and Attributes::into_deserializer() when serialize feature is enabled. This will allow do deserialize serde types right from attributes. Both methods returns the same type which implements serde's Deserializer and MapAccess 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 in Deserializer.

Misc Changes

  • #863: Remove From<QName<'a>> for BytesStart<'a> because now BytesStart stores the encoding in which its data is encoded, but QName is a simple wrapper around byte slice.
  • #766: BytesText::unescape and BytesText::unescape_with replaced by BytesText::decode. Now Text events does not contain escaped parts which are reported as Event::GeneralRef.

New Contributors

Full Changelog: v0.37.5...v0.38.0

v0.37.5 - BytesCData::decode()

27 Apr 07:43
Compare
Choose a tag to compare

What's Changed

New Features

  • #857: Add BytesCData::decode().

New Contributors

Full Changelog: v0.37.4...v0.37.5

v0.37.4 - Derive more traits for readers

01 Apr 08:37
Compare
Choose a tag to compare

What's Changed

Misc Changes

  • #852: Add Debug impl for NsReader and Reader and Clone impl for NsReader

New Contributors

Full Changelog: v0.37.3...v0.37.4

v0.37.3 - support for `xsi:nil` in Deserializer

25 Mar 19:43
Compare
Choose a tag to compare

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 has xsi:nil attribute set to true.
  • #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()

29 Dec 19:26
Compare
Choose a tag to compare

What's Changed

New Features

  • #836: Add se::to_utf8_io_writer() helper compatible with std::io::Write and restricted to UTF-8 encoding.

New Contributors

Full Changelog: v0.37.1...v0.37.2

v0.37.1 - Write CDATA safely

17 Nov 20:41
Compare
Choose a tag to compare

What's Changed

New Features

  • #831: Add BytesCData::escaped() fn to construct CDATA events from arbitrary user input.

New Contributors

Full Changelog: v0.37.0...v0.37.1

v0.37.0 - serde & errors imporvements

27 Oct 22:04
Compare
Choose a tag to compare

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> and From<Cow<str>> for quick_xml::de::Text.
  • #826: Make SimpleTypeDeserializer and SimpleTypeSerializer 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 or String).
  • #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 from DeError in the serialize feature. Serialize functions and methods now return SeError.
  • #810: Return std::io::Error from Writer methods.
  • #811: Split NamespaceError and EncodingError from Error.
  • #811: Renamed Error::EscapeError to Error::Escape to match other variants.
  • #811: Narrow down error return type from Error where only one variant is ever returned: attribute related methods on BytesStart and BytesDecl returns AttrError.
  • #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> or Vec<String> in $value fields. They cannot be deserialized back with the same result.
  • #827: Make escape and it variants take a impl Into<Cow<str>> argument and implement From<(&'a str, Cow<'a, str>)> on Attribute.
  • #826: Removed DeError::InvalidInt, DeError::InvalidFloat and DeError::InvalidBoolean. Now the responsibility for returning the error lies with the visitor of the type. See rationale in serde-rs/serde#2811

New Contributors

Full Changelog: v0.36.2...v0.37.0