RReverser / serde-xml-rs

xml-rs based deserializer for Serde (compatible with 1.0+)
https://crates.io/crates/serde-xml-rs
MIT License
270 stars 90 forks source link

Os serializer #45

Open oa-metaswitch opened 7 years ago

oa-metaswitch commented 7 years ago

Hi all.

I started working on a serializer a while back, and didn't realize that a different version had been submitted in the meantime. Unfortunately mine behaves a bit differently, so it would be difficult to merge it with the other serializer.

I thought I'd submit the code I have, though. It's reasonably feature complete, with support for maps, structs, tuples, and their various combinations, as well as sequences and XML namespaces.

Any chance this could be of use?

oli-obk commented 7 years ago

phew... could you run rustfmt? It's very hard to check out with all these unrelated formatting changes.

oa-metaswitch commented 7 years ago

Sorry about that.

My version of rustfmt seems happy with those changes. Should I be running with a particular version of rustfmt?

oli-obk commented 7 years ago

Are you using rustfmt-nightly or rustfmt?

oa-metaswitch commented 7 years ago

Looks like I'm using rustfmt. I'll try to run rustfmt-nightly and see how that goes. Thanks. :) [edited because I had it backwards]

oa-metaswitch commented 7 years ago

That did the trick. Thanks. :)

bjgill commented 6 years ago

As an interested third party, is this PR likely to get merged at any point in the near future?

oa-metaswitch commented 5 years ago

@RReverser: sorry to bother you again, but it's been a year and I'm keen that this thread doesn't go stale. It doesn't look like the serde feature is going to happen anytime soon, so would it make sense to either merge this as is or make some change so we can support both list types?

punkstarman commented 5 years ago

Looking at the PR, I noticed that xml_rs is not used to serialize, rather xmltree which requires keeping the whole DOM tree in memory before writing to a String or Write implementation.

This is clearly not scalable.

I would rather use the xml_rs writer to implement serialization. The only difficulty I've found is handling attributes.