-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edition2018 #274
Edition2018 #274
Conversation
self.write_event(event)?; | ||
self.write_event(Event::End(BytesEnd::borrowed(name)))?; | ||
Ok(()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to allow setting attributes without making it too difficult to use? e.g.
<checksum type="sha256">fc83446cfb15634f0200a29a0138e22a011ea4a064d531c0c53402b56a46ccab</checksum>
It might be hard to do with a single function, but maybe something that works similar to the Entry API for hash maps would work?
Something like this:
writer.create_node("checksum")
.push_attribute(("type", "sha256")
.push_attribute(("some_other", "attribute"))
.nested_event(Event::Text(...))
.write()?;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good suggestion let me try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you currently working on it? If not, I could give it a try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I got something more urgent to do at work. Feel free to give it a try I'll review.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tafia Do you have any plans for a new release soon? |
@tafia ^ |
@tafia It would be good to at least merge this PR to avoid conflicts with any other PRs |
Add an API that simplifies writing basic tag pairs and small amounts of content nesting in a more declarative fashion.
Quote characters (", ') are not strictly disallowed inside of element text. Provide a variant of the escape function which allows these characters.
… was not accessible to users That API was introduced in 7c9ba88 in tafia/quick-xml#274
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [quick-xml](https://github.com/tafia/quick-xml) | dependencies | patch | `0.23.0-alpha3` -> `0.23.0` | | [quick-xml](https://github.com/tafia/quick-xml) | dependencies | minor | `0.22.0` -> `0.23.0` | --- ### Release Notes <details> <summary>tafia/quick-xml</summary> ### [`v0.23.0`](https://github.com/tafia/quick-xml/blob/HEAD/Changelog.md#​0230----2022-05-08) - feat: add support for `i128` / `u128` in attributes or text/CDATA content - test: add tests for malformed inputs for serde deserializer - fix: allow to deserialize `unit`s from any data in attribute values and text nodes - refactor: unify errors when EOF encountered during serde deserialization - test: ensure that after deserializing all XML was consumed - feat: add `Deserializer::from_str`, `Deserializer::from_slice` and `Deserializer::from_reader` - refactor: deprecate `from_bytes` and `Deserializer::from_borrowing_reader` because they are fully equivalent to `from_slice` and `Deserializer::new` - refactor: reduce number of unnecessary copies when deserialize numbers/booleans/identifiers from the attribute and element names and attribute values - fix: allow to deserialize `unit`s from text and CDATA content. `DeError::InvalidUnit` variant is removed, because after fix it is no longer used - fix: `ElementWriter`, introduced in [#​274](tafia/quick-xml#274) (0.23.0-alpha2) now available to end users - fix: allow lowercase `<!doctype >` definition (used in HTML 5) when parse document from `&[u8]` - test: add tests for consistence behavior of buffered and borrowed readers - fix: produce consistent error positions in buffered and borrowed readers - feat: `Error::UnexpectedBang` now provide the byte found - refactor: unify code for buffered and borrowed readers - fix: fix internal panic message when parse malformed XML ([#​344](tafia/quick-xml#344)) - test: add tests for trivial documents (empty / only comment / `<root>...</root>` -- one tag with content) - fix: CDATA was not handled in many cases where it should - fix: do not unescape CDATA content because it never escaped by design. CDATA event data now represented by its own `BytesCData` type ([quick-xml#​311](tafia/quick-xml#311)) - feat: add `Reader::get_ref()` and `Reader::get_mut()`, rename `Reader::into_underlying_reader()` to `Reader::into_inner()` - refactor: now `Attributes::next()` returns a new type `AttrError` when attribute parsing failed ([#​4](Mingun/fast-xml#4)) - test: properly test all paths of attributes parsing ([#​4](Mingun/fast-xml#4)) - feat: attribute iterator now implements `FusedIterator` ([#​4](Mingun/fast-xml#4)) - fix: fixed many errors in attribute parsing using iterator, returned from `attributes()` or `html_attributes()` ([#​4](Mingun/fast-xml#4)) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Co-authored-by: crapStone <crapstone01@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1377 Reviewed-by: crapStone <crapstone@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Writer::write_nested_event
BytesStart::try_get_attribute