Skip to content

encoding/xml: does not reject colons in processing instruction targets #68393

Open
@DemiMarie

Description

@DemiMarie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions