Skip to content
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

While writing back xml document to a file it removes all comments #39

Closed
Ajay-MS opened this issue Nov 1, 2016 · 2 comments
Closed

Comments

@Ajay-MS
Copy link

Ajay-MS commented Nov 1, 2016

Hello Team,

I have an sample.xml file which contains comments also. Using xmldoc when i first convert it into a DOM structure and again write back dom to file it writes without comment. I think all comments are being committed by xmldoc when creating a DOM structure itself.

@nfarina
Copy link
Owner

nfarina commented Nov 4, 2016

Hi Ajay - The design goal of xmldoc was to be a "reader" of XML, and not a complete "XML Document Editor". Although it can "print out" XML documents, it makes no guarantees of round-trip accuracy, as you've experienced with comment nodes.

I do recognize that a lot of people wish for this functionality though, so if you would like to submit a PR that adds this functionality, in a way that doesn't add much complexity or new lines of code to the module, then I would be happy to review it!

@nfarina
Copy link
Owner

nfarina commented Dec 26, 2016

Closed by #43 - let me know if this doesn't work for you!

@nfarina nfarina closed this as completed Dec 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants