//CreateCommentNode creates a comment node. Comment nodes can // be children of an element or of the document itself. // // The data argument will become the content of the comment. func (document *XmlDocument) CreateCommentNode(data string) (comment *CommentNode) { dataBytes := GetCString([]byte(data)) dataPtr := unsafe.Pointer(&dataBytes[0]) nodePtr := C.xmlNewComment((*C.xmlChar)(dataPtr)) if nodePtr != nil { comment = NewNode(unsafe.Pointer(nodePtr), document).(*CommentNode) } return }
func (d *Document) CreateCommentNode(txt string) (*Comment, error) { return wrapComment(C.xmlNewComment(stringToXmlChar(txt))), nil }
// 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) }