Open jethrogb opened 7 years ago
@jethrogb if you still care about this issue, I believe I've solved it in #33. It requires a semver-breaking API change. To make the upgrade more comfortable for API consumers I threw the entire weight of modern Rust trait derivation behind my newtype:
Going even farther for users of old versions of @eminence's API, I decided to delegate all functions of XmlNamespace
:
There is no way within delegate
crate to do trait impl delegation, so the last remaining trait, IntoIterator
, I did by hand:
I added finally the obvious opposite trait (FromIterator
) that @netvl ought to consider upstream—
Due to the care taken to make the upgrade seamless I hope @eminence approves.
I'm experiencing the same issue, and dropping namespaces in attributes is a bit of a deal-breaker. Is there an ETA on when the PR will be merged or a known blocker to the merge?
Switching to the PR repository instead of the crates.io version fixed the issue and did not cause any incompatibility with my existing codebase.
@adri326 For me it's not just a bit of a deal breaker so the MFEK project uses my fork until #33 is approved. If it never is, I guess I can maintain it in perpetuity and backport any changes (should any be made) here.
@adri326 If you're interested, I just pushed the two changes I was missing from this master branch and reconciled #19 with my master at MFEK/xmltree.rlib in MFEK@8ca231ce9abd1a984b9be3e4d6438bceef2f58c5 and MFEK@447dcd6a39e7a154d07a5fc764afddc254f798ae.
Hopefully the MFEK branches don't need to be a long-term solution for you, but they can be. The tests do pass. The work by @dyst5422 looked fine to me so that's why I merged it.
Hey there!
I just stumbled upon this issue (that reading an xml file with this library, manipulating the in memory tree and writing it back out to a file causes attribute namespaces to get lost, see also: https://gitlab.com/thomas351/xml-sorter-rs )
I read above that @ctrlcctrlv maintains a fork that fixes that issue, so I've switched my dependency to that repository: https://github.com/MFEK/xmltree.rlib - works fine :)
Would be great if the fix could be merged into a crates.io release.
Thanks for the bump. It sounds like the fix from @ctrlcctrlv in #33 has some good reviews and successful usage in their fork.
I'll try to review these changes and get some stuff merged soon. Thanks for your patience.
My fork works fine for my use case (and the use cases of many others) but the issues raised by @tombailo and others are serious concerns as the whole point of namespaces is being able to have the same XML attr name provided by two different DTD's.
@tombailo made an attempt to patch overtop #33 in #38. We could really use a discussion between all of us on how to move forwards, I hadn't make progress as you'd not been around but the code in #38 looks like it may be workable and fix all issues but is a radical change.
Attributes can have namespaces, such as in:
(full XML at https://www.testshib.org/metadata/testshib-providers.xml)
The
xml
namespace on thelang
attribute is not stored: