serde-xml-rs icon indicating copy to clipboard operation
serde-xml-rs copied to clipboard

Os serializer

Open oa-metaswitch opened this issue 8 years ago • 8 comments

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?

oa-metaswitch avatar Sep 05 '17 15:09 oa-metaswitch

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

oli-obk avatar Sep 05 '17 15:09 oli-obk

Sorry about that.

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

oa-metaswitch avatar Sep 05 '17 16:09 oa-metaswitch

Are you using rustfmt-nightly or rustfmt?

oli-obk avatar Sep 05 '17 16:09 oli-obk

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 avatar Sep 06 '17 08:09 oa-metaswitch

That did the trick. Thanks. :)

oa-metaswitch avatar Sep 06 '17 09:09 oa-metaswitch

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

bjgill avatar Jun 13 '18 11:06 bjgill

@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?

oa-metaswitch avatar Nov 13 '18 10:11 oa-metaswitch

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.

punkstarman avatar Dec 20 '18 09:12 punkstarman