]> Cypherpunks repositories - gostls13.git/commit
encoding/xml: Reset the parent stack before printing a chardata or comment field...
authorHajime Hoshi <hajimehoshi@gmail.com>
Sat, 9 May 2015 19:22:11 +0000 (04:22 +0900)
committerroger peppe <rogpeppe@gmail.com>
Thu, 4 Jun 2015 07:16:25 +0000 (07:16 +0000)
commit2db587c0297224b9c525da0ed452502a4d2e0345
tree2b812f231a5fe28e85e5f8d7c6792a2925fc67a0
parent227fb116bede3b09ba7399303ebac36eec43ff8a
encoding/xml: Reset the parent stack before printing a chardata or comment field in a struct

This CL resets the parent stack when printing a character or comment field struct.
In the case of XML elements, the previous parents stack must be considered. However,
charadata or comment fields can't be printed in other fields so it seems required to reset
the parent stack each time a chardata or comment field is printed.

Fixes #5072

Change-Id: I84f61c9bfce94133cd0c076c11211b9be5b4b1ac
Reviewed-on: https://go-review.googlesource.com/9910
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: roger peppe <rogpeppe@gmail.com>
src/encoding/xml/marshal.go
src/encoding/xml/marshal_test.go