func ParseFragment(content, inEncoding, url []byte, options int, outEncoding []byte) (fragment *xml.DocumentFragment, err error) { inEncoding = AppendCStringTerminator(inEncoding) outEncoding = AppendCStringTerminator(outEncoding) document := CreateEmptyDocument(inEncoding, outEncoding) fragment, err = parsefragment(document, nil, content, url, options) C.xmlDocSetRootElement((*C.xmlDoc)(document.DocPtr()), (*C.xmlNode)(fragment.Node.NodePtr())) return }
func (d *Document) SetDocumentElement(n Node) { C.xmlDocSetRootElement(d.ptr, (*C.xmlNode)(n.pointer())) d.root = (*C.xmlNode)(n.pointer()) }
// xmlDocSetRootElement func (doc *Document) SetRoot(root *Node) *Node { cnode := C.xmlDocSetRootElement(doc.Ptr, root.Ptr) return makeNode(cnode) }