Trying to do an exact rebuild
Hi, I'm trying to modify a XML file and rebuilding it, avoiding any mismatch. So I'm parsing it using:
{
explicitRoot: false,
preserveChildrenOrder: true,
explicitChildren: true
}
This way, I'm getting the exact representation of the original XML, but I cannot rebuild it this way with the default builder. How can I achieve this?
Thanks!
This would be interesting for me as well. Do you plan to release an update that supports building of an xml from an object that was parsed using these settings soon?
No plans at the moment. I am doubting that adding XML output was a good idea to start with.
Thats a pity. I need this feature. I'm trying to implement it and if I succeed I will contribute it.
#307
The pull req is created. I copied all builder unit tests to ensure having the expected result when building an xml.
@Leonidas-from-XIV currently you are trying to create an exact JSON object with preserved order but you have never checked how the XML will look that is built from an exact object. So how do you make sure that your object built with explicitChildren and preserveOrder contains everything necessary? My tests are covering this and the pull request also contains fixes for building this object.
Unfortunately your recent commits are conflicting with my changes. I don't have time to fix the merge conflicts because its implemented once for a project of a client. If you are willing to merge the pull request I would resolve the conflicts once. Otherwise I will abandon my fork.