var innerXML bytes.Buffer
var writeSettings etree.WriteSetting
for _, child := range element.Child {
child.WriteTo(&innerXML, &writeSettings)
}
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.
Sorry about the double pull requests, needed to free up master for use as a dependency, but couldn't change the pull branch for the PR. New PR: https://github.com/beevik/etree/pull/97
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.