func HtmlNodeDump(n unsafe.Pointer) string { buf := C.xmlBufferCreate() C.htmlNodeDump(buf, nil, C.xmlNodePtr(n)) cstr := C.xmlBufferContent(buf) str := C.GoString(xmlCharToC(cstr)) C.xmlBufferFree(buf) return str }
func (n *xmlNode) ToString(format int, docencoding bool) string { // TODO: Implement htis in C buffer := C.xmlBufferCreate() defer C.xmlBufferFree(buffer) if format <= 0 { C.xmlNodeDump(buffer, n.ptr.doc, n.ptr, 0, 0) } else { oIndentTreeOutput := C.MY_setXmlIndentTreeOutput(1) C.xmlNodeDump(buffer, n.ptr.doc, n.ptr, 0, C.int(format)) C.MY_setXmlIndentTreeOutput(oIndentTreeOutput) } return xmlCharToString(C.xmlBufferContent(buffer)) }
// xmlBufferCreate func NewBuffer() *Buffer { return &Buffer{C.xmlBufferCreate()} }