Skip to content
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

Serde can't deserialize cdata using $value #186

Closed
sify21 opened this issue Jan 9, 2020 · 4 comments
Closed

Serde can't deserialize cdata using $value #186

sify21 opened this issue Jan 9, 2020 · 4 comments
Labels
duplicate serde Issues related to mapping from Rust types to XML

Comments

@sify21
Copy link

sify21 commented Jan 9, 2020

rust definition:

#[derive(Debug, Deserialize, PartialEq)]
struct After {
    #[serde(rename = "$value")]
    body: Option<String>,
}

xml fragment:

<After><![CDATA[some string]]></After>

body field is set to None

@tafia
Copy link
Owner

tafia commented Feb 1, 2020

Indeed, CData nodes are currently ignored (as well as Comments, PI, Decl, DocType).
We could perhaps revisit this.

@filip-minic
Copy link

Hi,

is there a way to fix this (workaround)? Also, it seems this is not serde related, in general quick-xml ignores CDATA, correct me if I am wrong?

For my use case this is also somewhat of a pain, since I have to first clean the xml, which is 20+ GB.

Best Regards

@sify21
Copy link
Author

sify21 commented Apr 1, 2020

while, I parsed my xml by hand, using the read_event method.

notice: There is an Event::Text before and after the Event::CData

@Mingun
Copy link
Collaborator

Mingun commented May 21, 2022

Duplicate of #384

This bug is fixed.

@Mingun Mingun closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2022
@Mingun Mingun added duplicate serde Issues related to mapping from Rust types to XML labels May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

No branches or pull requests

4 participants