-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose WriteTo for tokens, define the needed writer interface
This makes it possible to write XML fragments without having to copy elements to a separate document. Also satisfies the InnerXML use-case from #71 ``` 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.
- Loading branch information
1 parent
672dfa1
commit a291eec
Showing
2 changed files
with
25 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters