Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
Fix crash when printing Namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
hellodword authored May 6, 2024
1 parent b65cd51 commit cee446d
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 cee446d

Please sign in to comment.