Skip to content

Commit

Permalink
fix: Improper namespace application in elementToBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-clerk committed Nov 14, 2024
1 parent bbccb79 commit fc21993
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,11 @@ func elementToBytes(el *etree.Element) ([]byte, error) {
doc := etree.NewDocument()
doc.SetRoot(el.Copy())
for space, uri := range namespaces {
doc.Root().CreateAttr("xmlns:"+space, uri)
if space == "" {
doc.Root().CreateAttr("xmlns", uri)
} else {
doc.Root().CreateAttr("xmlns:"+space, uri)
}
}

return doc.WriteToBytes()
Expand Down

0 comments on commit fc21993

Please sign in to comment.