예제 #1
0
// xmlNewDocRawNode
func (doc *Document) NewRawNode(ns *Namespace, name string, content string) *Node {
	ptrn := C.CString(name)
	defer C.free_string(ptrn)
	ptrc := C.CString(content)
	defer C.free_string(ptrc)
	if ns != nil {
		return makeNode(C.xmlNewDocRawNode(doc.Ptr, ns.Ptr, C.to_xmlcharptr(ptrn), C.to_xmlcharptr(ptrc)))
	}
	return makeNode(C.xmlNewDocRawNode(doc.Ptr, nil, C.to_xmlcharptr(ptrn), C.to_xmlcharptr(ptrc)))
}
예제 #2
0
func XmlNewDocRawNode(doc unsafe.Pointer, ns unsafe.Pointer, name string, content string) unsafe.Pointer {
	cname := cToXmlChar(C.CString(name))
	ccontent := cToXmlChar(C.CString(content))
	cnode := C.xmlNewDocRawNode(C.xmlDocPtr(doc), C.xmlNsPtr(ns), cname, ccontent)
	C.free(unsafe.Pointer(cname))
	C.free(unsafe.Pointer(ccontent))
	return unsafe.Pointer(cnode)
}