func nodeValue(n Node) string { switch n.NodeType() { case AttributeNode, TextNode, CommentNode, CDataSectionNode, PiNode, EntityRefNode: return xmlCharToString(C.xmlXPathCastNodeToString((*C.xmlNode)(n.pointer()))) case EntityDecl: np := (*C.xmlNode)(n.pointer()) if np.content != nil { return xmlCharToString(C.xmlStrdup(np.content)) } panic("unimplmented") } return "" }
func (n *xmlNode) TextContent() string { return xmlCharToString(C.xmlXPathCastNodeToString(n.ptr)) }