Commit bded824c authored by Paul Warren's avatar Paul Warren
Browse files

Strip xmlns attribute from Token().

parent 726e67ca
......@@ -269,23 +269,26 @@ func (d *Decoder) Token() (t Token, err error) {
// attributes apply to the element name and
// to the other attribute names, so process
// the translations first.
attrTmp := []Attr{}
for _, a := range t1.Attr {
if a.Name.Space == "xmlns" {
v, ok := d.ns[a.Name.Local]
d.pushNs(a.Name.Local, v, ok)
d.ns[a.Name.Local] = a.Value
}
if a.Name.Space == "xml" && a.Name.Local == "lang" {
} else if a.Name.Space == "xml" && a.Name.Local == "lang" {
d.pushLang(d.lang)
d.lang = a.Value
}
if a.Name.Space == "" && a.Name.Local == "xmlns" {
} else if a.Name.Space == "" && a.Name.Local == "xmlns" {
// Default space for untagged names
v, ok := d.ns[""]
d.pushNs("", v, ok)
d.ns[""] = a.Value
} else {
attrTmp = append(attrTmp, a)
}
}
t1.Attr = attrTmp
d.translate(&t1.Name, true)
for i := range t1.Attr {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment