Adds optional indented output for the Node.String() and Node.Bytes()

methods. Set the global `IndentPrefix` var to a tab or spaces to
enable indented output. The existing API has not been changed.

This addresses issue #7.
This commit is contained in:
jimt 2012-11-25 23:46:56 +01:00
parent 88d4341915
commit c085b35fb9
4 changed files with 92 additions and 17 deletions

View file

@ -74,6 +74,7 @@ func TestSave(t *testing.T) {
return
}
IndentPrefix = "\t"
if err := doc.SaveFile("test1.xml"); err != nil {
t.Errorf("SaveFile(): %s", err)
return