-
Notifications
You must be signed in to change notification settings - Fork 47
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
How to control reference naming and remove namespaces? #385
Comments
Hi @jamesquox thanks for writing in. You will be able to remove a To address your questions here:
If you have specialized requirements to remove additional text/characters/symbols for use with another system, I would for sure recommend using XSLT for this as that is exactly how it is intended to be used. :) Please let me know if you have any further questions and I will do my best to answer here. 👍 |
Cheers Mike for the confirmation👍 |
Years old and already answered, but i still want to return to this due to it being a rather critical and common feature of XML serialization usecases. The System.Xml library supports overriding and attributing namespaces specifically because many of the use cases require explicitly setting something in a given namespace and lack of support for explicit namespaces makes this unsuitable as is for the purpose. My usecase here being generation of a model with varying namespaces depending on who's asking, i could either duplicate thousands of lines of code, or control this one feature that is supported by the underlying Xml. If i can come up with a way to support this without breaking functionality or by adding new functionality for one way transformations cleanly, are still open for PR's and reviewing said work should you agree with a proposal? |
Hi @RiversJohn thank you for your inquiry. I am certainly open to working on a PR with you. Primarily, if you can contain the changes in an extension so that users must call a particular method during the container-creation process (and thereby constrain its unintended effects) then that is ideal. Of course, all existing tests must pass, as well. I also want to be sure you understand that this repo is for all intents and purposes in a maintenance state. Sadly, (even as cool as ExtendedXmlSerializer is) my recommendation these days is to use JSON if possible as that is far better supported by Microsoft these days, and we never really quite got a community to actively support this repository. That stated, there is always the possibility to build a community here. :) If someone wants to work on a PR with the above goals I will do my best to assist them to head in this direction. 👍 |
Thank you for your speedy reply @Mike-E-angelo I was aware of the maintenance, hence the question if you'd possibly be up for it since this would obviously be quite outside the scope of just maintenance. My personal time at least for the next few months is quite limited but depending on our needs i might be able to devote work time on this if using EXS is the route we pick. The consumers of the outputs we're generating don't accept JSON, only CSV / XML and they're huge corps meaning there's little probability of influencing them to accept other formats. I'll get back to you on this if i can go forward with this and check the proposal idea with you to make sure it's compatible in implementation. |
Glad to hear you are feeling better @RiversJohn. 🙏 And for the rest that sounds like a good plan. 👍 |
First of all a thank you for spending your time to create this masterpiece.
I have two questions/issues that I can't wrap my head around and hopefully you can tell me that it can't be done and I can move on =)
At the moment I'm performing a regex replace to alter the output xml, but hoped I could do something to ease this.
I've set up a dotnetfiddle here.
The current output:
The output I'm after:
And my test program:
Thanks to anyone who reads this :)
The text was updated successfully, but these errors were encountered: