diff options
| author | Russ Cox <rsc@golang.org> | 2024-03-08 18:25:14 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-03-08 18:46:41 +0000 |
| commit | 32014d549609422748dcb698fef1d43a5a33b0b4 (patch) | |
| tree | 163cd85fd56ff2d701291d314eedb4e327a0d185 /src/encoding/xml/xml_test.go | |
| parent | a46285f8c2389b92952c1484daacfccf70a17047 (diff) | |
| download | go-32014d549609422748dcb698fef1d43a5a33b0b4.tar.xz | |
Revert "encoding/xml: reject XML declaration after start of document"
This reverts commit 8a0fbd75a54c27ff2ae624ac2775bf752cdbceb4.
Reason for revert: Breaking real-world tests inside Google,
which means it probably breaks real-world tests outside Google.
One instance I have seen is a <!-- --> comment (often a copyright notice) before the procinst.
Another test checks that a canonicalizer can handle a test input that simply has procinsts mid-XML.
XML is full of contradictions, XML implementations more so. If we are going to start being picky, that probably needs to be controlled by a GODEBUG (and a proposal).
For #65691 (will reopen manually).
Change-Id: Ib52d0944b1478e71744a2a35b271fdf7e1c972ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/570175
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/encoding/xml/xml_test.go')
| -rw-r--r-- | src/encoding/xml/xml_test.go | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/encoding/xml/xml_test.go b/src/encoding/xml/xml_test.go index c3848c3873..a6763fd547 100644 --- a/src/encoding/xml/xml_test.go +++ b/src/encoding/xml/xml_test.go @@ -1352,12 +1352,10 @@ func TestParseErrors(t *testing.T) { // Header-related errors. {`<?xml version="1.1" encoding="UTF-8"?>`, `unsupported version "1.1"; only version 1.0 is supported`}, - {`<foo><?xml version="1.0"?>`, `XML declaration after start of document`}, // Cases below are for "no errors". {withDefaultHeader(`<?ok?>`), ``}, {withDefaultHeader(`<?ok version="ok"?>`), ``}, - {` <?xml version="1.0"?>`, ``}, } for _, test := range tests { |
