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

Minicom XML parser/writer #138

Closed
wants to merge 2 commits into from
Closed

Minicom XML parser/writer #138

wants to merge 2 commits into from

Conversation

burrbull
Copy link
Member

@burrbull burrbull commented Jan 31, 2021

I tried to replace xmltree with minicom, which uses quick-xml.
But I have problem. Since 0.13 version it requires xmlns namespace to be used to build each Element.

In other hand compiling with 0.12 version fails with:

error[E0277]: `Rc<minidom::namespace_set::NamespaceSet>` cannot be sent between threads safely
  --> src/types.rs:96:93
   |
96 |                     return Err(SVDError::InvalidBooleanValue(tree.clone(), text.clone(), e).into())
   |                                                                                             ^^^^ `Rc<minidom::namespace_set::NamespaceSet>` cannot be sent between threads safely

I like also roxmltree crate for high-level interaction with xml. But it can be used for parse only.

#109

@brainstorm
Copy link
Contributor

/cc @Marcoleni


let info = ClusterInfo::parse(tree)?;

if tree.get_child("dimIncrement").is_some() {
if tree.get_child("dimIncrement", NS).is_some() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather these be crate::NS instead of importing them

<mock xmlns=\""
.to_string()
+ NS
+ "\">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunate

@brainstorm
Copy link
Contributor

brainstorm commented Feb 8, 2021

I suspect that with YaSerDe you might have better luck doing this? I had a bad time trying to tell quick-xml to basically differentiate between attribute and child but it was comparatively very easy with YaSerDe.

See the docs I just pushed there for reference: media-io/yaserde#106

As much as I dislike the typical "yet another" libs, they seem to be the strongest contender, even reporting progress back to Rust RFCs:

https://users.rust-lang.org/t/rfc-serde-xml-support/737/15

@burrbull burrbull closed this Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants