Skip to content

Failed to parse attributes with colon #6

Closed

Description

@minherz

When trying to parse XML with attributes that have a colon in name, the parsing fails. For example, the following code prints failed!:

s := `<?xml version="1.0" encoding="utf-8"?><rss xml:id="1-1"/><rss xml:id="1-2"/>`
doc, err := xmlquery.Parse(strings.NewReader(s))
node := doc.SelectElement(`//rss[@xml:id='1-2']`)
if node == nil {
  fmt.Print("failed!")
}

Activity

  1. added a commit that references this issue on Jun 22, 2026
    9438270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址