Skip to content

Releases: tafia/quick-xml

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

v0.36.2 - Fix DOCTYPE parsing

20 Sep 17:40
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • #533: Fix incorrect DocType closing bracket detection when parsing with buffered reader

Full Changelog: v0.36.1...v0.36.2

v0.36.1 - Read binary from XML

23 Jul 15:37
Compare
Choose a tag to compare

What's Changed

New Features

  • #623: Added Reader::stream() that can be used to read arbitrary data from the inner reader while track position for XML reader.

Full Changelog: v0.36.0...v0.36.1

v0.36.0 - Compatibility with Adobe Flash

08 Jul 16:41
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • #781: Fix conditions to start CDATA section. Only uppercase <![CDATA[ can start it.
    Previously any case was allowed.
  • #780: Fixed incorrect .error_position() when encountering syntax error for open or self-closed tag.

Misc Changes

  • #780: reader::Parser, reader::ElementParser and reader::PiParser moved to the new module parser.
  • #776: Allow to have attributes in the end tag for compatibility reasons with Adobe Flash XML parser.

Full Changelog: v0.35.0...v0.36.0

v0.35.0 - a couple of bugfixes

29 Jun 16:42
Compare
Choose a tag to compare

What's Changed

New Features

  • #772: Add reader::Config::allow_unmatched_ends to permit dangling end tags.

Bug Fixes

  • #773: Fixed reporting incorrect end position in Reader::read_to_end family of methods and trimming of the trailing spaces in Reader::read_text when trim_text_start is set and the last event is not a Text event.
  • #771: Character references now allow any number of leading zeroes as it should. As a result, the following variants of quick_xml::escape::EscapeError are removed:
    • TooLongDecimal
    • TooLongHexadecimal
  • #771: Fixed Attribute::unescape_value which does not unescape predefined values since 0.32.0.
  • #774: Fixed regression since 0.33.0: Text event may be skipped in read_event_into() and read_event_into_async() in some circumstances.

Misc Changes

  • #771: EscapeError::UnrecognizedSymbol renamed to EscapeError::UnrecognizedEntity.
  • #771: Implemented PartialEq for EscapeError.
  • #771: Replace the following variants of EscapeError by InvalidCharRef variant with a new ParseCharRefError inside:
    • EntityWithNull
    • InvalidDecimal
    • InvalidHexadecimal
    • InvalidCodepoint

New Contributors

Full Changelog: v0.34.0...v0.35.0

v0.34.0 - allow to read 4GB+ files on 32-bit targets

24 Jun 20:18
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • #751: Fix internal overflow when read 4GB+ files on 32-bit targets using Reader<impl BufRead> readers.

Misc Changes

  • #760: Attribute::decode_and_unescape_value and Attribute::decode_and_unescape_value_with now accepts Decoder instead of Reader. Use Reader::decoder() to get it.
  • #760: Writer::write_event now consumes event. Use Event::borrow() if you want to keep ownership.
  • #751: Type of Reader::error_position() and Reader::buffer_position() changed from usize to u64.
  • #751: Type alias Span changed from Range<usize> to Range<u64>.

Full Changelog: v0.33.0...v0.34.0

v0.33.0 - Make compile time small again

21 Jun 15:59
Compare
Choose a tag to compare

What's Changed

New Features

  • #758: Implemented From<QName> for BytesStart and BytesEnd.

Bug Fixes

  • #755: Fix incorrect missing of trimming all-space text events when
    trim_text_start = false and trim_text_end = true.

Misc Changes

  • #650: Change the type of Event::PI to a new dedicated BytesPI type.
  • #759: Make 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()
  • #763: Hide quick_xml::escape::resolve_html5_entity under escape-html feature again.
    This function has significant influence to the compilation time (10+ seconds or 5x times)

Full Changelog: v0.32.0...v0.33.0