Query Suggestion Options
Last word completion
Keyboard Layouts
GitHub

👀 While it's loading, feel free to check out the other repositories:

🔔 To get a notification when it's ready, leave your email here:

By entering your email, you agree to receive notifications and marketing-related emails

Filter by reset

3494 results 17 ms in tafia/quick-xml

(De)serializing `xsi` attributes (`xsi:type`, `xsi:nil` etc.)

I'm currently working the following XML: <items> <Item xsi:type="Weapon">...</Item> <Item xsi:nil="true" /> <Item xsi:type="Shovel">...</Item> <Item xsi:nil="true" /> <Item xsi:nil="true" /> <Item xsi:nil="true" /> <Item xsi:type="Food">...</Item> </items …

furtidevfurtidev · 2024-10-15 · 2 · #822

How would I parse character references as literal bytes and not codepoints?

DekkonotDekkonot · 2025-05-09 · 4 · #667

I may be wrong, but it seems that you should use <element>&#x1F603;</element> instead. Character references are supposed to refer to the Unicode code points directly, not to bytes in some unspecified encoding. A non-normative confirmation of this can be …

MingunMingun · 2023-10-16

Unwrap optional list of elements panic

I've been trying to adapt the elements list example in the "Frequently used patterns" section of the docs to unwrap an optional list of tags. Here is a minimal example: lib.rs use serde::{Deserialize, Serialize, de}; fn unwrap_abc_opt<'de, D>(deserializer …

synapticarborssynapticarbors · 2025-07-07 · 1 · #876

questionserde

Make BytesCData decode method public

mematthiasmematthias · 2025-04-26 · 2 · #857

:warning: Please install the to ensure uploads and comments are reliably processed by Codecov. Codecov Report All modified and coverable lines are covered by tests :white_check_mark: Project coverage is 60.74%. Comparing base ( a9391f3 ) to head ( 4acc194 …

codecov-commentercodecov-commenter · 2025-04-26

Fix: the `serialize` feature should also enable `serde/derive`

In master/last release serialize feature implicitly depends on serde/derive . Just add resolve = "2" to Cargo.toml to see the following: error[E0433]: failed to resolve: could not find `Deserialize` in `serde` --> src/name.rs:19:45 | 19 | #[cfg_attr( …

loydloyd · 2022-09-08 · 8 · #472

enhancementserde

Deserialization of a doctype with very long content fails

benoitryderbenoitryder · 2024-09-20 · 7 · #533

2👍2

bughelp wanted

This even happens if there's anything after the <!DOCTYPE> line: comments <?xml-stylesheet> Can we fix this? I would be up to do this since from_str won't work otherwise.

hecatia-eleguahecatia-elegua · 2023-05-19

Start rewrite serde serialization tests

Our serde serializer a far from ideal, but rewriting it requires a very long commit history, as I think (I already have 20 commits and I suspect that I'll double that count...). Because I'm not a big fan of long PRs, I propose that changes, that rewrites …

MingunMingun · 2022-09-04 · 3 · #468

serde

Deserialize array failed when tags discontinuous

CaisinCaisin · 2024-09-28 · 1 · #809

questionserdearrays

Enable overlapped-lists feature.

MingunMingun · 2024-09-28

Add a `read_text` implementation for async readers

This adds a read_text_into_async method for Readers which allows writing the content in between nested tags to an arbitrary AsyncWriter , analogous to Reader::read_text and NsReader::read_text respectively.

BitSyndicate1BitSyndicate1 · 2025-04-22 · 0 · #856

#[serde(rename = "$value")] for Enum Variants

marcfirmarcfir · 2025-03-11 · 4 · #847

questionserde

What you trying to achieve? <A> <a>hjk</a> <b>88</b> </A> could be parsed into #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, Default)] enum Choice { #[serde(rename = "A")] One { a: String, b: i32 }, #[default] Two, } (not tested)

MingunMingun · 2025-02-26

ergonomics & encodings

Hi there, I've just been playing around with quick-xml to handle reading and writing of Glyph Interchange Format files, and I had some observations I wanted to share. [u8] / Cow<[u8]> vs Cow<str> My understanding is that quick-xml attempts to do the least …

cmyrcmyr · 2025-06-08 · 12 · #158

8👍8

enhancementencoding

Problem deserializing a struct that can be serialized

KorribanMasterKorribanMaster · 2024-06-03 · 2 · #752

bughelp wantedserdearrays

To check it out yourself i uploaded a simple example project to reproduce the error https://github.com/KorribanMaster/example_quick_xml

KorribanMasterKorribanMaster · 2024-06-03

Is it as expect that Option attribute serialize into empty string instead of non-attribute.

A simple example here. use serde::Serialize; use quick_xml::se::to_string; #[derive(Serialize)] struct Foo { #[serde(rename = "@foo")] foo: Option<usize> } #[test] fn test_foo() { let foo = Foo { foo: None }; let foo_xml = to_string(&foo).unwrap(); assert …

VonfryVonfry · 2023-12-03 · 1 · #692

serdedocumentation

XML deserializate failed when text contains `&()_+-=;`

XuanwoXuanwo · 2024-02-28 · 6 · #719

1👀1

questionserde

In the mentioned case should be possible to keep unrecognized entities unexpanded. We have EntityResolver trait and default NoEntityResolver that does nothing. However, I assume, that entity &()_+-=; was formed just by luck. If there would no ; character, …

MingunMingun · 2024-02-27

Allow `�` character references

We should either restrict all invalid characters both in literal form and as character references, or none of them. Disallowing only the one character is inconsistently. Because checking literal forms means that we should decode and check all the input, …

MingunMingun · 2024-06-05 · 6 · #750

Deserializing to variant vector fields fails

MoSalMoSal · 2024-08-06 · 4 · #288

2👍2

bugserdearrays

I hit this error as well. I added a test case ( de::tests::enum_::internally_tagged::collection_struct::attributes ) in the vec-invariant branch on my fork. It fails with: ---- de::tests::enum_::internally_tagged::collection_struct::attributes stdout ---- …

cpickcpick · 2021-07-19

Add ability to deserialize serde types from `Reader`

When working with deeply nested xml, most of the time, we are only interested in a portion of the whole tree close to the leaf node. My idea is to extract the string of the target node and deserialize it with serde. But I can't find any convenient way to …

ndtoan96ndtoan96 · 2024-09-01 · 6 · #611

3👍3

enhancementhelp wantedserde

Fix couple of bugs in serde deserializer

MingunMingun · 2022-12-12 · 3 · #523

bugserde

Codecov Report Merging #523 (2b9228d) into master (6347f3b) will increase coverage by 0.07% . The diff coverage is 72.72% . @@ Coverage Diff @@ ## master #523 +/- ## ========================================== + Coverage 61.70% 61.77% +0.07% …

codecov-commentercodecov-commenter · 2022-12-11

With serde, is it possible to get unknown variant names outside of a deserializing error?

I'm using serde to deserialize a file format that looks something like this: <root> <list> <type1>content</type1> <type2>a new and exciting content type </type2> <!-- etc --> </list> </root> This is easy to implement and I've done so using an enum because …

DekkonotDekkonot · 2023-06-05 · 3 · #602

questionserde

Deserializing $primitive= gives some problems.

stchyshstchysh · 2024-10-08 · 1 · #817

questionserde

What the quick-xml version you use? Support for $unflatten= prefix was removed in 0.27.0. You need to use the overlapped-lists feature in modern quick-xml and #[serde(rename = "$unflatten=...")] renames does not needed, remove them. Attributes should be …

MingunMingun · 2024-10-08

Update maybe_xml dependency 0.3 -> 0.6

maybe_xml is still about 1.5x--2x faster that quick-xml in most tests, except those: rpm_other linescore test_writer_ident players Here is criterion report: comparison.zip

MingunMingun · 2023-10-17 · 1 · #668

Add new tests for syntax and ill-formed parser errors and fix... emm... errors

MingunMingun · 2023-11-22 · 1 · #684

bug

Codecov Report Attention: 20 lines in your changes are missing coverage. Please review. Comparison is base ( 64c4249 ) 65.14% compared to head ( 2c55638 ) 65.31%. Files Patch % Lines src/errors.rs 9.09% 10 Missing :warning: src/reader/mod.rs 93.81% 6 …

codecov-commentercodecov-commenter · 2023-11-22

Remove ignored tests which produces warnings since serde 1.0.215

They are never will be implemented anyway. You need to implement deserialization manually if you want two xs:choice fields in your struct.

MingunMingun · 2024-11-22 · 0 · #833

Use thiserror crate to make error definition more ergonomic.

wtwt · 2023-09-09 · 10 · #640

It should be noted that this is currently a draft as it only changes the main error type and not the other errors. FWIW, I really like how it makes the code more concise. Even more of this may be possible since it can also handle common cases for …

wtwt · 2023-08-27

Lists can be serialized but the result can not be deserialized

quickl xml is not able to deserialize an empty vector. Example below panics at the deserializing of the serialized struct use serde; use quick_xml; #[derive(serde::Serialize, serde::Deserialize)] struct Elements { #[serde(rename = "list")] elems: Vec<()>, …

GunnarMorriganGunnarMorrigan · 2023-11-17 · 4 · #682

serdearrays

de: consider local name only for namespaced tags in structs with `$value`

XiphoseerXiphoseer · 2024-05-13 · 10 · #736

serdenamespaces

Hey, thank you for the review. My case is probably closer to #212, but that was closed as a duplicate of #347. I agree that a regression test would be useful so I'll add one when I find time for it. This change doesn't do anything to fix serialization, …

XiphoseerXiphoseer · 2024-04-12

Issue deserializing lists of enums using serde derive

I'm trying to parse xml with the structure <root><string>A</string><string>B</string></root> . I've tried to implement this using serde derive macros as its easier to maintain. The code I've tried is use serde::{Deserialize, Serialize}; #[derive(Serialize …

maddymakesgamesmaddymakesgames · 2024-02-08 · 1 · #712

serdearrays

Fix incorrect test for 580 and get rid of allocations in hot path

MingunMingun · 2023-10-09 · 1 · #662

serdeoptimization

Codecov Report Merging #662 (9e8158c) into master (c79ad58) will increase coverage by 0.03% . The diff coverage is 84.78% . :exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@ ## master …

codecov-commentercodecov-commenter · 2023-10-07

Lifetime issue in new unbuffered logic

I have been trying out the new alpha version and I think I stumbled upon a kinda-bug. Somehow something that should be possible is not, I think because of the way lifetimes are indicated in some methods. I'm trying to find a fix, but to reproduce the …

stevenroosestevenroose · 2022-08-15 · 3 · #329

deserialize_struct loses the main element

gkorlandgkorland · 2023-02-20 · 3 · #448

1👍1

serde

slightly off topic: could someone edit the title of this issue to replace loose with the correct word lose. Title should be " deserialize_struct loses the main element"…

spazmspazm · 2023-02-20

How to use value of e.name without temporary value dropped while borrowed error?

I'm new to Rust, I wanna store the name of the current tag in a variable, so I can create a HashMap using the name as key and its content as value, This is my code: fn parser() { let reader = Reader::from_file("12.xml"); if let Err(e) = reader { panic!("{ …

bangbaewbangbaew · 2023-08-10 · 2 · #628

question

schema generator

ThomblinThomblin · 2023-12-15 · 2 · #694

Thanks a lot for your input. I assume that you want to parse multiple XML files to receive a better matching struct as a result: Actually that was on my list of ideas and I was able to implement that with minimal effort (new function extend_struct beside …

ThomblinThomblin · 2023-12-12

quick-xml v0.27+ changed behaviour when writing empty values

I'm using quick-xml for my XML-RPC crate (dxr) and I've been a happy user so far, thank you for maintaining the crate! I'm trying to update my quick-xml dependency to a newer version (dxr is currently stuck at v0.25), but I'm hitting a roadblock. It looks …

decathorpedecathorpe · 2023-06-30 · 7 · #617

enhancementhelp wantedserde

Fix Windows test cases

ajtribickajtribick · 2021-08-11 · 3 · #259

Thanks! Indeed writing \r\n is probably a better default on windows,

tafiatafia · 2021-02-08

Question about xml modes

I'm looking through the AttrError and noticed several references to iteration/parsing modes This error can be raised only when the iterator is in XML mode. ...depending on the parsing mode. I'm curious how this can be done. I've tried searching through …

noahbaldnoahbald · 2024-04-20 · 2 · #735

question

Add reserved namespace bindings.

wtwt · 2023-09-06 · 33 · #545

Just so we know, the std versions of the oncecell stuff that I used in this PR is being stabilized as we speak. Part of the work landed in 1.70. The lazy initialized types have not yet landed in stable. However, that may happen in one of the next couple …

wtwt · 2023-06-07

Between 0.37.5 and 0.38.0 deserialized String fields stopped stripping whitespace

Hello all. Using attached fragment, the deserialisation of a String field seems to changes between 0.37.5 and 0.38.0. Rightly or wrongly 0.37.5 would happily strip/trim whitespace, but 0.38.0 does not do that anymore. use serde::Deserialize; use std::io …

packetsourcepacketsource · 2025-07-11 · 3 · #877

serde

Between 0.37.5 and 0.38.0 deserialized String fields stopped stripping whitespace

packetsourcepacketsource · 2025-07-11 · 3 · #877

serde

Looks like it may be deliberate to adhere to a standard, not sure. Is there a way to achieve the trim_text behaviour as a non-default option then, I wonder?

packetsourcepacketsource · 2025-07-11

Fails on empty comments without 4 -"

The parser was crashing because of bad slice bounds Closes #604

TptTpt · 2023-06-28 · 5 · #618

unexpected Event::EOF

snmpboysnmpboy · 2025-06-13 · 2 · #867

questionserde

Please provide some details: What version of quick_xml you are using? Do you parse using borrowing or buffered reader (how you create a Deserializer )? The error comes from serde deserializer. What types are you deserializing? Do you have manual …

MingunMingun · 2025-06-13