Skip to content

Commit

Permalink
Fix crash when printing Namespaces (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellodword committed May 21, 2024
1 parent 376cf9e commit a75c203
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dom/node_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ func (n *Namespace) Free() {
clib.XMLNamespaceFree(n)
n.ptr = 0
}

// String returns the stringified Namespace
func (n *Namespace) String() string {
prefix := n.Prefix()
if prefix != "" {
prefix = ":" + prefix
}
return "xmlns" + prefix + `="` + n.URI() + `"`
}

0 comments on commit a75c203

Please sign in to comment.