Skip to content

Commit 7113fd9

Browse files
committed
Add comment about "well-formed" XML to ValidateInput
1 parent 3267736 commit 7113fd9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

etree.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,16 @@ type ReadSettings struct {
5050
// preserve them instead of keeping only one. Default: false.
5151
PreserveDuplicateAttrs bool
5252

53-
// ValidateInput forces all ReadFrom* methods to validate that the
54-
// provided input is composed of well-formed XML before processing it. If
55-
// invalid XML is detected, the ReadFrom* methods return an error. Because
56-
// this option requires the input to be processed twice, it incurs a
53+
// ValidateInput forces all ReadFrom* functions to validate that the
54+
// provided input is composed of "well-formed"(*) XML before processing it.
55+
// If invalid XML is detected, the ReadFrom* functions return an error.
56+
// Because this option requires the input to be processed twice, it incurs a
5757
// significant performance penalty. Default: false.
58+
//
59+
// (*) Note that this definition of "well-formed" is in the context of the
60+
// go standard library's encoding/xml package. Go's encoding/xml package
61+
// does not, in fact, guarantee well-formed XML as specified by the W3C XML
62+
// recommendation. See: https://github.com/golang/go/issues/68299
5863
ValidateInput bool
5964

6065
// Entity to be passed to standard xml.Decoder. Default: nil.

0 commit comments

Comments
 (0)