Open
Description
Go version
1.22
Output of go env
in your module/workspace:
What is on https://go.dev/play as of when this issue is filed
What did you do?
Ran this Go code:
package main
import (
"encoding/xml"
"fmt"
)
func main() {
err := xml.Unmarshal([]byte(`<?a:b?><a/>`), new(interface{}))
if err != nil {
fmt.Printf("XML correctly rejected with error %#v", err)
} else {
fmt.Println("No error?")
}
}
What did you see happen?
No error?
output, indicating that unmarshalling was successful.
What did you expect to see?
An error because processing instruction targets cannot contain colons in a namespace-well-formed document.