Versions in this module Expand all Collapse all v0 v0.1.0 Aug 8, 2026 Changes in this version + type Attr struct + Name string + Namespace string + Prefix string + Value string + type Builder struct + func NewBuilder() *Builder + func NewHTMLBuilder() *Builder + func (b *Builder) Attr(name, value string) *Builder + func (b *Builder) CDATA(s string) *Builder + func (b *Builder) Comment(s string) *Builder + func (b *Builder) Document() *Document + func (b *Builder) Element(name string, fn func(*Builder)) *Builder + func (b *Builder) ElementText(name, text string) *Builder + func (b *Builder) Root() *Node + func (b *Builder) Text(s string) *Builder + func (b *Builder) ToHTML() string + func (b *Builder) ToXML() string + type Document struct + func HTML(s string) (*Document, error) + func HTML5(s string) (*Document, error) + func HTMLFragment(s string) (*Document, error) + func HTMLFragmentReader(r io.Reader) (*Document, error) + func HTMLReader(r io.Reader) (*Document, error) + func NewDocument() *Document + func XML(s string) (*Document, error) + func (d *Document) AtCSS(selector string) (*Node, error) + func (d *Document) AtXPath(expr string) (*Node, error) + func (d *Document) CSS(selector string) (*NodeSet, error) + func (d *Document) NewCDATA(s string) *Node + func (d *Document) NewComment(s string) *Node + func (d *Document) NewElement(name string) *Node + func (d *Document) NewPI(name, data string) *Node + func (d *Document) NewText(s string) *Node + func (d *Document) XPath(expr string) (*NodeSet, error) + type Namespace struct + Prefix string + URI string + type Node struct + Attrs []*Attr + Name string + NsURI string + Prefix string + Type NodeType + func (n *Node) AddChild(child *Node) *Node + func (n *Node) AddNamespace(prefix, uri string) *Namespace + func (n *Node) AddNextSibling(sib *Node) *Node + func (n *Node) AddPreviousSibling(sib *Node) *Node + func (n *Node) AtCSS(selector string, nsMap map[string]string) (*Node, error) + func (n *Node) AtXPath(expr string, nsMap map[string]string) (*Node, error) + func (n *Node) Attribute(name string) string + func (n *Node) Attributes() map[string]*Attr + func (n *Node) CSS(selector string, nsMap map[string]string) (*NodeSet, error) + func (n *Node) Children() *NodeSet + func (n *Node) Content() string + func (n *Node) Document() *Document + func (n *Node) ElementChildren() *NodeSet + func (n *Node) EvalXPath(expr string, nsMap map[string]string) (any, error) + func (n *Node) EvalXPathCtx(expr string, nsMap map[string]string, ctx *XPathContext) (any, error) + func (n *Node) FirstChild() *Node + func (n *Node) Get(name string) (string, bool) + func (n *Node) HasAttribute(name string) bool + func (n *Node) InnerHTML() string + func (n *Node) InnerXML() string + func (n *Node) IsCDATA() bool + func (n *Node) IsComment() bool + func (n *Node) IsElement() bool + func (n *Node) IsText() bool + func (n *Node) LastChild() *Node + func (n *Node) Namespace() *Namespace + func (n *Node) NamespaceDeclarations() []*Namespace + func (n *Node) Namespaces() map[string]string + func (n *Node) Next() *Node + func (n *Node) NextElement() *Node + func (n *Node) NodeName() string + func (n *Node) NodeType() NodeType + func (n *Node) Parent() *Node + func (n *Node) Prepend(child *Node) *Node + func (n *Node) Previous() *Node + func (n *Node) PreviousElement() *Node + func (n *Node) Remove() + func (n *Node) RemoveAttribute(name string) + func (n *Node) Replace(repl *Node) *Node + func (n *Node) Root() *Node + func (n *Node) SetAttribute(name, value string) + func (n *Node) SetContent(s string) + func (n *Node) Text() string + func (n *Node) ToHTML() string + func (n *Node) ToS() string + func (n *Node) ToXML() string + func (n *Node) Wrap(markup string) (*Node, error) + func (n *Node) XPath(expr string, nsMap map[string]string) (*NodeSet, error) + type NodeSet struct + func NewNodeSet(nodes []*Node) *NodeSet + func (s *NodeSet) At(i int) *Node + func (s *NodeSet) CSS(selector string) (*NodeSet, error) + func (s *NodeSet) Each(fn func(*Node)) + func (s *NodeSet) Empty() bool + func (s *NodeSet) First() *Node + func (s *NodeSet) Last() *Node + func (s *NodeSet) Length() int + func (s *NodeSet) Nodes() []*Node + func (s *NodeSet) Text() string + func (s *NodeSet) XPath(expr string) (*NodeSet, error) + type NodeType int + const AttributeNode + const CDATANode + const CommentNode + const DoctypeNode + const DocumentNode + const ElementNode + const ProcessingInstructionNode + const TextNode + type SAXDocument struct + func (SAXDocument) CdataBlock(string) + func (SAXDocument) Characters(string) + func (SAXDocument) Comment(string) + func (SAXDocument) EndDocument() + func (SAXDocument) EndElement(string) + func (SAXDocument) Error(string) + func (SAXDocument) ProcessingInstruction(string, string) + func (SAXDocument) StartDocument() + func (SAXDocument) StartElement(string, []*Attr) + type SAXHandler interface + CdataBlock func(text string) + Characters func(text string) + Comment func(text string) + EndDocument func() + EndElement func(name string) + Error func(message string) + ProcessingInstruction func(target, data string) + StartDocument func() + StartElement func(name string, attrs []*Attr) + type SAXParser struct + func NewSAXParser(h SAXHandler) *SAXParser + func (p *SAXParser) Parse(s string) error + func (p *SAXParser) ParseReader(r io.Reader) error + type XPathContext struct + Current *Node + Position int + ResolveFunc func(name string, args []any) (result any, ok bool) + Size int + Vars map[string]any