Exemple #1
0
// Set the local name of the node. The namespace is set via SetNamespace().
func (xmlNode *XmlNode) SetName(name string) {
	if len(name) > 0 {
		nameBytes := GetCString([]byte(name))
		namePtr := unsafe.Pointer(&nameBytes[0])
		C.xmlNodeSetName(xmlNode.Ptr, (*C.xmlChar)(namePtr))
	}
}
Exemple #2
0
// xmlNodeSetName
func (node *Node) SetName(name string) {
	ptr := C.CString(name)
	defer C.free_string(ptr)
	C.xmlNodeSetName(node.Ptr, C.to_xmlcharptr(ptr))
}
Exemple #3
0
func (n *xmlNode) SetNodeName(name string) {
	C.xmlNodeSetName(n.ptr, stringToXmlChar(name))
}
Exemple #4
0
// NodeSetName sets the name/tag of a node
func (xp *Xp) NodeSetName(node *C.xmlNode, name string) {
	Cname := unsafe.Pointer(C.CString(name))
	C.xmlNodeSetName(C.xmlNodePtr(node), (*C.xmlChar)(Cname))
	C.free(Cname)
}