Closed hugowetterberg closed 1 year ago
I really like your proposed change. Could you please resolve conflicts and update the pull request?
I realize it's been nearly 3 years since you submitted this pull request, so I apologize sincerely for not seeing it sooner. I will understand if you are not interested in updating the pull request.
No worries, and thank you for your work in creating and maintaining etree. It has been of great help when working with XML in go.
Unfortunately I have changed jobs since I made the PR, so I don't have write access to the Infomaker repository any more. But I'll make a private fork and sort out the conflicts in a separate PR.
Thanks for the update. I've committed this change with a few modifications. I renamed XMLWriter
to Writer
since I felt the "XML" was extraneous. I also added a unit test and the ability to indent a fragment starting with an Element
token.
This makes it possible to write XML fragments without having to copy elements to a separate document.
Also satisfies the InnerXML use-case from https://github.com/beevik/etree/issues/71
In my actual use-case I just passed in
&doc.WriteSettings
, but there might also be a legitimate need to write out fragments with other settings. So I find a parameter preferrable to using the settings of a hidden associated document.