// xmlNewNs func (node *Node) NewNs(href string, prefix string) *Namespace { ptrh := C.CString(href) defer C.free_string(ptrh) ptrp := C.CString(prefix) defer C.free_string(ptrp) return makeNamespace(C.xmlNewNs(node.Ptr, C.to_xmlcharptr(ptrh), C.to_xmlcharptr(ptrp))) }
// xmlNewNode func NewNode(ns *Namespace, name string) *Node { ptr := C.CString(name) defer C.free_string(ptr) if ns != nil { return makeNode(C.xmlNewNode(ns.Ptr, C.to_xmlcharptr(ptr))) } return makeNode(C.xmlNewNode(nil, C.to_xmlcharptr(ptr))) }
// xmlSetProp func (node *Node) SetAttribute(name string, value string) *Attribute { ptrn := C.CString(name) defer C.free_string(ptrn) ptrv := C.CString(value) defer C.free_string(ptrv) cattr := C.xmlSetProp(node.Ptr, C.to_xmlcharptr(ptrn), C.to_xmlcharptr(ptrv)) return makeAttribute(cattr) }
// xmlParseDTD func ParseDTD(ExternalID string, SystemID string) *Dtd { ptre := C.CString(ExternalID) defer C.free_string(ptre) ptrs := C.CString(SystemID) defer C.free_string(ptrs) cdtd := C.xmlParseDTD(C.to_xmlcharptr(ptre), C.to_xmlcharptr(ptrs)) return makeDtd(cdtd) }
// xmlNewDocProp func (doc *Document) NewProp(name string, value string) *Attribute { ptrn := C.CString(name) defer C.free_string(ptrn) ptrv := C.CString(value) defer C.free_string(ptrv) cattr := C.xmlNewDocProp(doc.Ptr, C.to_xmlcharptr(ptrn), C.to_xmlcharptr(ptrv)) return makeAttribute(cattr) }
// htmlNewDoc func NewHTMLDoc(uri string, external_id string) *HTMLDocument { ptru := C.CString(uri) defer C.free_string(ptru) ptre := C.CString(external_id) defer C.free_string(ptre) doc := C.htmlNewDoc(C.to_xmlcharptr(ptru), C.to_xmlcharptr(ptre)) return makeHTMLDoc(doc) }
// xmlNewTextChild func (node *Node) NewTextChild(ns *Namespace, name string, content string) *TextNode { ptrn := C.CString(name) defer C.free_string(ptrn) ptrc := C.CString(content) defer C.free_string(ptrc) if ns == nil { return makeTextNode(C.xmlNewTextChild(node.Ptr, nil, C.to_xmlcharptr(ptrn), C.to_xmlcharptr(ptrc))) } return makeTextNode(C.xmlNewTextChild(node.Ptr, ns.Ptr, C.to_xmlcharptr(ptrn), C.to_xmlcharptr(ptrc))) }
// xmlNewDtd func (doc *Document) NewDtd(name string, ExternalID string, SystemID string) *Dtd { ptrn := C.CString(name) defer C.free_string(ptrn) ptre := C.CString(ExternalID) defer C.free_string(ptre) ptrs := C.CString(SystemID) defer C.free_string(ptrs) cdtd := C.xmlNewDtd(doc.Ptr, C.to_xmlcharptr(ptrn), C.to_xmlcharptr(ptre), C.to_xmlcharptr(ptrs)) return makeDtd(cdtd) }
// 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))) }
// htmlParseDoc func ParseHTMLDoc(cur string, encoding string) *HTMLDocument { ptrc := C.CString(cur) defer C.free_string(ptrc) ptre := C.CString(encoding) defer C.free_string(ptre) doc := C.htmlParseDoc(C.to_xmlcharptr(ptrc), ptre) return makeHTMLDoc(doc) }
// htmlReadDoc func ReadHTMLDoc(cur string, url string, encoding string, options HTMLParserOption) *HTMLDocument { ptrc := C.CString(cur) defer C.free_string(ptrc) ptru := C.CString(url) defer C.free_string(ptru) ptre := C.CString(encoding) defer C.free_string(ptre) doc := C.htmlReadDoc(C.to_xmlcharptr(ptrc), ptru, ptre, C.int(options)) return makeHTMLDoc(doc) }
// xmlCtxtReadDoc func (p *Parser) ReadDoc(input string, url string, encoding string, options ParserOption) *Document { ptri := C.CString(input) defer C.free_string(ptri) ptru := C.CString(url) defer C.free_string(ptru) ptre := C.CString(encoding) defer C.free_string(ptre) doc := C.xmlCtxtReadDoc(p.Ptr, C.to_xmlcharptr(ptri), ptru, ptre, C.int(options)) return makeDoc(doc) }
// xmlTextReaderGetAttribute func (r *TextReader) GetAttribute(name string) *string { cname := C.CString(name) defer C.free_string(cname) cvalue := C.xmlTextReaderGetAttribute(r.Ptr, C.to_xmlcharptr(cname)) if cvalue != nil { value := C.GoString(C.to_charptr(cvalue)) return &value } return nil }
// xmlNodeSetName func (node *Node) SetName(name string) { ptr := C.CString(name) defer C.free_string(ptr) C.xmlNodeSetName(node.Ptr, C.to_xmlcharptr(ptr)) }
func stringToXmlChar(s string) *C.xmlChar { return C.to_xmlcharptr(C.CString(s)) }
// xmlValidateQName func ValidateQName(value string, space int) int { ptr := C.CString(value) defer C.free_string(ptr) return int(C.xmlValidateQName(C.to_xmlcharptr(ptr), C.int(space))) }
// xmlUnsetProp func (node *Node) UnsetProp(name string) int { ptr := C.CString(name) defer C.free_string(ptr) cint := C.xmlUnsetProp(node.Ptr, C.to_xmlcharptr(ptr)) return int(cint) }
// xmlTextConcat func (node *TextNode) Concat(content string) int { ptr := C.CString(content) defer C.free_string(ptr) return int(C.xmlTextConcat(node.Ptr, C.to_xmlcharptr(ptr), C.int(len(content)))) }
// xmlNewDocText func (doc *Document) NewText(content string) *TextNode { ptr := C.CString(content) defer C.free_string(ptr) return makeTextNode(C.xmlNewDocText(doc.Ptr, C.to_xmlcharptr(ptr))) }
// xmlRecoverDoc func RecoverDoc(cur string) *Document { ptr := C.CString(cur) defer C.free_string(ptr) doc := C.xmlRecoverDoc(C.to_xmlcharptr(ptr)) return makeDoc(doc) }
// xmlXPathEvalExpression func (ctx *XPathContext) EvalExpression(str string) *XPathObject { ptr := C.CString(str) defer C.free_string(ptr) return makeXpathObj(C.xmlXPathEvalExpression(C.to_xmlcharptr(ptr), ctx.Ptr)) }
// xmlNewText func NewText(content string) *TextNode { ptr := C.CString(content) defer C.free_string(ptr) return makeTextNode(C.xmlNewText(C.to_xmlcharptr(ptr))) }
// htmlAutoCloseTag func (doc *HTMLDocument) AutoCloseTag(name string, node *Node) bool { ptr := C.CString(name) defer C.free_string(ptr) return int(C.htmlAutoCloseTag(doc.Document.Ptr, C.to_xmlcharptr(ptr), node.Ptr)) == 1 }
// xmlNewComment func NewComment(content string) *Node { ptr := C.CString(content) defer C.free_string(ptr) cnode := C.xmlNewComment(C.to_xmlcharptr(ptr)) return makeNode(cnode) }
// xmlCreateDocParserCtxt func CreateDocParser(cur string) *Parser { ptr := C.CString(cur) defer C.free_string(ptr) cparser := C.xmlCreateDocParserCtxt(C.to_xmlcharptr(ptr)) return makeParser(cparser) }
// htmlTagLookup func TagLookup(tag string) *ElemDesc { ptr := C.CString(tag) defer C.free_string(ptr) cdesc := C.htmlTagLookup(C.to_xmlcharptr(ptr)) return makeElemDesc(cdesc) }
// xmlXPathCtxtCompile func (ctx *XPathContext) Compile(str string) *XPath { ptr := C.CString(str) defer C.free_string(ptr) return makeXpath(C.xmlXPathCtxtCompile(ctx.Ptr, C.to_xmlcharptr(ptr))) }
// xmlNewDoc func NewDoc(version string) *Document { ptr := C.CString(version) defer C.free_string(ptr) cdoc := C.xmlNewDoc(C.to_xmlcharptr(ptr)) return makeDoc(cdoc) }
// xmlXPathCompile func CompileXPath(str string) *XPath { ptr := C.CString(str) defer C.free_string(ptr) return makeXpath(C.xmlXPathCompile(C.to_xmlcharptr(ptr))) }
// xmlNodeSetContent func (node *Node) SetContent(content string) { ptr := C.CString(content) defer C.free_string(ptr) C.xmlNodeSetContent(node.Ptr, C.to_xmlcharptr(ptr)) }