-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support of xml comments #22
Comments
Hi Reza, I'd say the current behavior is "design-by-omission". xmldoc was not really intended to allow you to modify XML and write it back to disk - the toString() method is only meant for debugging. In order to support comments we'd have to introduce a new XML node type which would move this library away from the "simple XML parser" that it's meant to be. Perhaps you could try parsing your XML using a more full-featured library like elementtree? |
Fixes #22 Also discards "extra" XML information outside the first root node, like trailing comments or extra nodes, since we have no sensible place to store them in our data structure.
Changed my mind on this. Thanks for the request! |
I am trying to use this library to keep track of version dependency of pom files. (by the way it is awesome and thank you very much for sharing it). The only problem I have is that the comments will be stripped of the original file once I use toString() to write it back to the disk.
Looking at the code I don't see the oncomment event being captured. is this by design, or is there another way to capture comments?
Regards,
Reza
The text was updated successfully, but these errors were encountered: