Esempio n. 1
0
func HtmlNewDoc(uri string, external_id string) unsafe.Pointer {
	curi := cToXmlChar(C.CString(uri))
	cexternal_id := cToXmlChar(C.CString(external_id))
	cdoc := C.htmlNewDoc(curi, cexternal_id)
	C.free(unsafe.Pointer(curi))
	C.free(unsafe.Pointer(cexternal_id))
	return unsafe.Pointer(cdoc)
}
Esempio n. 2
0
// 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)
}
Esempio n. 3
0
func CreateEmptyDocument(inEncoding, outEncoding []byte) (doc *HtmlDocument) {
	C.xmlInitParser()
	docPtr := C.htmlNewDoc(nil, nil)
	doc = NewDocument(unsafe.Pointer(docPtr), 0, inEncoding, outEncoding)
	return
}