Documentation ¶
Overview ¶
Package dom provides methods and structs to construct and manipulate a simple Document Object Model
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
Attributes of an Element node
func (Attributes) BoolD ¶
func (a Attributes) BoolD(name string, defaultv bool) bool
BoolD retrieves the attribute [name]. Returns [defaultv] if not found
func (Attributes) FirstAttr ¶
func (a Attributes) FirstAttr(name string, names ...string) string
FirstAttr returns the value of the first attibute that is found (if the name matches)
func (Attributes) HasAttr ¶
func (a Attributes) HasAttr(name string, names ...string) bool
HasAttr returns true if one of the attributes is found
func (Attributes) IntD ¶
func (a Attributes) IntD(name string, defaultv int) int
IntD retrieves the attribute [name]. Returns [defaultv] if not found
func (Attributes) String ¶
func (a Attributes) String(name string) string
String returns an attribute value
type ElementNode ¶
type ElementNode interface { Node TagName() string Children() []Node Attributes() Attributes ID() string Classes() []string Append(n Node) SetAttribute(name, value string) DeleteAttribute(name string) FirstChildAsText() string FindChildByID(id string) Node }
ElementNode is a structured node that may contain attributes and children
type Node ¶
type Node interface {
Type() NodeType
}
Node is a valid DOM node
func ParseXMLString ¶
ParseXMLString parses a XLM string.
Click to show internal directories.
Click to hide internal directories.