From 32014d549609422748dcb698fef1d43a5a33b0b4 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 8 Mar 2024 18:25:14 +0000 Subject: 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 LUCI-TryBot-Result: Go LUCI Auto-Submit: Russ Cox --- src/encoding/xml/xml_test.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/encoding/xml/xml_test.go') 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. {``, `unsupported version "1.1"; only version 1.0 is supported`}, - {``, `XML declaration after start of document`}, // Cases below are for "no errors". {withDefaultHeader(``), ``}, {withDefaultHeader(``), ``}, - {` `, ``}, } for _, test := range tests { -- cgit v1.3-5-g9baa