Documentation ¶
Index ¶
- Constants
- func Encode(node Node, writer io.Writer) error
- type Attr
- type BasicAttr
- func (node *BasicAttr) AppendChild(newNode Node) Node
- func (attr *BasicAttr) CloneNode(bool) Node
- func (node *BasicAttr) Contains(nd Node) bool
- func (node *BasicAttr) GetChildNodes() NodeList
- func (node *BasicAttr) GetFirstChild() Node
- func (node *BasicAttr) GetLastChild() Node
- func (attr *BasicAttr) GetLocalName() string
- func (attr *BasicAttr) GetName() string
- func (node *BasicAttr) GetNextSibling() Node
- func (attr *BasicAttr) GetNodeName() string
- func (attr *BasicAttr) GetNodeType() NodeType
- func (node *BasicAttr) GetOwnerDocument() Document
- func (attr *BasicAttr) GetOwnerElement() Element
- func (node *BasicAttr) GetParentElement() Element
- func (node *BasicAttr) GetParentNode() Node
- func (node *BasicAttr) GetPreviousSibling() Node
- func (attr *BasicAttr) GetQName() Name
- func (node *BasicAttr) GetRootNode() Node
- func (attr *BasicAttr) GetValue() string
- func (node *BasicAttr) HasChildNodes() bool
- func (node *BasicAttr) InsertBefore(newNode, referenceNode Node) Node
- func (node *BasicAttr) IsDefaultNamespace(uri string) bool
- func (attr *BasicAttr) IsEqualNode(node Node) bool
- func (attr *BasicAttr) IsSameNode(node Node) bool
- func (node *BasicAttr) LookupNamespaceURI(prefix string) string
- func (node *BasicAttr) LookupPrefix(uri string) string
- func (node *BasicAttr) Normalize()
- func (node *BasicAttr) RemoveChild(child Node)
- func (attr *BasicAttr) SetValue(v string)
- type BasicComment
- func (cd *BasicComment) AppendChild(Node) Node
- func (cd *BasicComment) CloneNode(deep bool) Node
- func (cd *BasicComment) GetNodeName() string
- func (cd *BasicComment) GetNodeType() NodeType
- func (cd *BasicComment) GetValue() string
- func (cd *BasicComment) HasChildNodes() bool
- func (cd *BasicComment) InsertBefore(newNode, referenceNode Node) Node
- func (cd *BasicComment) IsEqualNode(node Node) bool
- func (cd *BasicComment) IsSameNode(node Node) bool
- func (cs *BasicComment) Normalize()
- func (cs *BasicComment) RemoveChild(Node)
- func (cd *BasicComment) SetValue(text string)
- type BasicDocument
- func (doc *BasicDocument) AdoptNode(node Node) Node
- func (doc *BasicDocument) AppendChild(newNode Node) Node
- func (doc *BasicDocument) CloneNode(deep bool) Node
- func (node *BasicDocument) Contains(nd Node) bool
- func (doc *BasicDocument) CreateAttribute(name string) Attr
- func (doc *BasicDocument) CreateAttributeNS(prefix string, ns string, name string) Attr
- func (doc *BasicDocument) CreateComment(text string) Comment
- func (doc *BasicDocument) CreateElement(tag string) Element
- func (doc *BasicDocument) CreateElementNS(prefix string, ns string, tag string) Element
- func (doc *BasicDocument) CreateProcessingInstruction(target, data string) ProcessingInstruction
- func (doc *BasicDocument) CreateTextNode(text string) Text
- func (node *BasicDocument) GetChildNodes() NodeList
- func (doc *BasicDocument) GetDocumentElement() Element
- func (doc *BasicDocument) GetDocumentType() DocumentType
- func (node *BasicDocument) GetFirstChild() Node
- func (node *BasicDocument) GetLastChild() Node
- func (node *BasicDocument) GetNextSibling() Node
- func (doc *BasicDocument) GetNodeName() string
- func (doc *BasicDocument) GetNodeType() NodeType
- func (node *BasicDocument) GetOwnerDocument() Document
- func (node *BasicDocument) GetParentElement() Element
- func (node *BasicDocument) GetParentNode() Node
- func (node *BasicDocument) GetPreviousSibling() Node
- func (node *BasicDocument) GetRootNode() Node
- func (node *BasicDocument) HasChildNodes() bool
- func (doc *BasicDocument) InsertBefore(newNode, referenceNode Node) Node
- func (doc *BasicDocument) IsDefaultNamespace(uri string) bool
- func (doc *BasicDocument) IsEqualNode(node Node) bool
- func (doc *BasicDocument) IsSameNode(node Node) bool
- func (doc *BasicDocument) LookupNamespaceURI(prefix string) string
- func (doc *BasicDocument) LookupPrefix(uri string) string
- func (doc *BasicDocument) Normalize()
- func (doc *BasicDocument) NormalizeNamespaces() error
- func (doc *BasicDocument) RemoveChild(child Node)
- type BasicDocumentType
- func (node *BasicDocumentType) AppendChild(newNode Node) Node
- func (node *BasicDocumentType) CloneNode(bool) Node
- func (node *BasicDocumentType) Contains(nd Node) bool
- func (node *BasicDocumentType) GetChildNodes() NodeList
- func (dt *BasicDocumentType) GetDefinition() string
- func (node *BasicDocumentType) GetFirstChild() Node
- func (node *BasicDocumentType) GetLastChild() Node
- func (dt *BasicDocumentType) GetName() string
- func (node *BasicDocumentType) GetNextSibling() Node
- func (node *BasicDocumentType) GetNodeName() string
- func (dt *BasicDocumentType) GetNodeType() NodeType
- func (node *BasicDocumentType) GetOwnerDocument() Document
- func (node *BasicDocumentType) GetParentElement() Element
- func (node *BasicDocumentType) GetParentNode() Node
- func (node *BasicDocumentType) GetPreviousSibling() Node
- func (dt *BasicDocumentType) GetPublicID() string
- func (node *BasicDocumentType) GetRootNode() Node
- func (dt *BasicDocumentType) GetSystemID() string
- func (node *BasicDocumentType) HasChildNodes() bool
- func (node *BasicDocumentType) InsertBefore(newNode, referenceNode Node) Node
- func (node *BasicDocumentType) IsDefaultNamespace(uri string) bool
- func (node *BasicDocumentType) IsEqualNode(Node) bool
- func (node *BasicDocumentType) IsSameNode(Node) bool
- func (node *BasicDocumentType) LookupNamespaceURI(prefix string) string
- func (node *BasicDocumentType) LookupPrefix(uri string) string
- func (node *BasicDocumentType) Normalize()
- func (node *BasicDocumentType) RemoveChild(child Node)
- type BasicElement
- func (el *BasicElement) AppendChild(newNode Node) Node
- func (el *BasicElement) CloneNode(deep bool) Node
- func (node *BasicElement) Contains(nd Node) bool
- func (el *BasicElement) GetAttribute(name string) (string, bool)
- func (el *BasicElement) GetAttributeNS(uri string, name string) (string, bool)
- func (el *BasicElement) GetAttributeNames() []string
- func (el *BasicElement) GetAttributeNode(name string) Attr
- func (el *BasicElement) GetAttributeNodeNS(uri, name string) Attr
- func (el *BasicElement) GetAttributes() NamedNodeMap
- func (node *BasicElement) GetChildNodes() NodeList
- func (node *BasicElement) GetFirstChild() Node
- func (el *BasicElement) GetFirstElementChild() Element
- func (node *BasicElement) GetLastChild() Node
- func (el *BasicElement) GetLastElementChild() Element
- func (el *BasicElement) GetLocalName() string
- func (el *BasicElement) GetNextElementSibling() Element
- func (node *BasicElement) GetNextSibling() Node
- func (el *BasicElement) GetNodeName() string
- func (el *BasicElement) GetNodeType() NodeType
- func (node *BasicElement) GetOwnerDocument() Document
- func (node *BasicElement) GetParentElement() Element
- func (node *BasicElement) GetParentNode() Node
- func (el *BasicElement) GetPrefix() string
- func (el *BasicElement) GetPreviousElementSibling() Element
- func (node *BasicElement) GetPreviousSibling() Node
- func (el *BasicElement) GetQName() Name
- func (node *BasicElement) GetRootNode() Node
- func (el *BasicElement) GetTagName() string
- func (el *BasicElement) HasAttribute(name string) bool
- func (el *BasicElement) HasAttributeNS(uri string, name string) bool
- func (node *BasicElement) HasChildNodes() bool
- func (el *BasicElement) InsertBefore(newNode, referenceNode Node) Node
- func (el *BasicElement) IsDefaultNamespace(uri string) bool
- func (el *BasicElement) IsEqualNode(node Node) bool
- func (el *BasicElement) IsSameNode(node Node) bool
- func (el *BasicElement) LookupNamespaceURI(prefix string) string
- func (el *BasicElement) LookupPrefix(uri string) string
- func (el *BasicElement) Normalize()
- func (el *BasicElement) Remove()
- func (el *BasicElement) RemoveAttribute(name string)
- func (el *BasicElement) RemoveAttributeNS(uri string, name string)
- func (el *BasicElement) RemoveAttributeNode(attr Attr)
- func (el *BasicElement) RemoveChild(child Node)
- func (el *BasicElement) SetAttribute(name string, value string)
- func (el *BasicElement) SetAttributeNS(prefix, uri, name string, value string)
- func (el *BasicElement) SetAttributeNode(attr Attr)
- func (el *BasicElement) SetAttributeNodeNS(attr Attr)
- type BasicNamedNodeMap
- type BasicNodeList
- type BasicProcessingInstruction
- func (cd *BasicProcessingInstruction) AppendChild(Node) Node
- func (p *BasicProcessingInstruction) CloneNode(deep bool) Node
- func (p *BasicProcessingInstruction) GetNodeName() string
- func (p *BasicProcessingInstruction) GetNodeType() NodeType
- func (p *BasicProcessingInstruction) GetTarget() string
- func (cd *BasicProcessingInstruction) GetValue() string
- func (cd *BasicProcessingInstruction) HasChildNodes() bool
- func (cd *BasicProcessingInstruction) InsertBefore(newNode, referenceNode Node) Node
- func (p *BasicProcessingInstruction) IsEqualNode(node Node) bool
- func (p *BasicProcessingInstruction) IsSameNode(node Node) bool
- func (cs *BasicProcessingInstruction) Normalize()
- func (cs *BasicProcessingInstruction) RemoveChild(Node)
- func (p *BasicProcessingInstruction) SetTarget(t string)
- func (cd *BasicProcessingInstruction) SetValue(text string)
- type BasicText
- func (cd *BasicText) AppendChild(Node) Node
- func (cd *BasicText) CloneNode(deep bool) Node
- func (cd *BasicText) GetNodeName() string
- func (cd *BasicText) GetNodeType() NodeType
- func (cd *BasicText) GetValue() string
- func (cd *BasicText) HasChildNodes() bool
- func (cd *BasicText) InsertBefore(newNode, referenceNode Node) Node
- func (cd *BasicText) IsEqualNode(node Node) bool
- func (cd *BasicText) IsSameNode(node Node) bool
- func (cs *BasicText) Normalize()
- func (cs *BasicText) RemoveChild(Node)
- func (cd *BasicText) SetValue(text string)
- type CharacterData
- type Comment
- type Document
- type DocumentType
- type Element
- type ErrDOM
- type Name
- type NamedNodeMap
- type Node
- type NodeList
- type NodeType
- type ProcessingInstruction
- type Text
Constants ¶
const ( INDEX_SIZE_ERR = "INDEX_SIZE" DOMSTRING_SIZE_ERR = "DOMSTRING_SIZE" HIERARCHY_REQUEST_ERR = "HIERARCHY_REQUEST" WRONG_DOCUMENT_ERR = "WRONG_DOCUMENT" INVALID_CHARACTER_ERR = "INVALID_CHARACTER" NO_DATA_ALLOWED_ERR = "NO_DATA_ALLOWED" NO_MODIFICATION_ALLOWED_ERR = "NO_MODIFICATION_ALLOWED" NOT_FOUND_ERR = "NOT_FOUND" NOT_SUPPORTED_ERR = "NOT_SUPPORTED" INUSE_ATTRIBUTE_ERR = "INUSE_ATTRIBUTE" INVALID_STATE_ERR = "INVALID_STATE" SYNTAX_ERR = "SYNTAX" INVALID_MODIFICATION_ERR = "INVALID_MODIFICATION" NAMESPACE_ERR = "NAMESPACE" INVALID_ACCESS_ERR = "INVALID_ACCESS" VALIDATION_ERR = "VALIDATION" TYPE_MISMATCH_ERR = "TYPE_MISMATCH" SECURITY_ERR = "SECURITY" NETWORK_ERR = "NETWORK" ABORT_ERR = "ABORT" URL_MISMATCH_ERR = "URL_MISMATCH" QUOTA_EXCEEDED_ERR = "QUOTA_EXCEEDED" TIMEOUT_ERR = "TIMEOUT" INVALID_NODE_TYPE_ERR = "INVALID_NODE_TYPE" DATA_CLONE_ERR = "DATA_CLONE" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attr ¶
type Attr interface { Node // A String representing the local part of the qualified name of the // attribute. GetLocalName() string // Returns the qualified name of an attribute, that is the name of // the attribute, with the namespace prefix, if any, in front of // it. For example, if the local name is lang and the namespace // prefix is xml, the returned qualified name is xml:lang. GetName() string GetQName() Name // The Element the attribute belongs to. GetOwnerElement() Element // The attribute's value, a string that can be set and get using this // property. GetValue() string SetValue(string) }
type BasicAttr ¶
type BasicAttr struct {
// contains filtered or unexported fields
}
func (*BasicAttr) AppendChild ¶
Append newNode as a child of node
func (*BasicAttr) Contains ¶
Returns true or false value indicating whether or not a node is a descendant of the calling node.
func (*BasicAttr) GetChildNodes ¶
func (node *BasicAttr) GetChildNodes() NodeList
Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.
func (*BasicAttr) GetFirstChild ¶
func (node *BasicAttr) GetFirstChild() Node
Returns a Node representing the first direct child node of the node, or null if the node has no child.
func (*BasicAttr) GetLastChild ¶
func (node *BasicAttr) GetLastChild() Node
Returns a Node representing the last direct child node of the node, or null if the node has no child.
func (*BasicAttr) GetLocalName ¶
A String representing the local part of the qualified name of the attribute.
func (*BasicAttr) GetName ¶
Returns the qualified name of an attribute, that is the name of the attribute, with the namespace prefix, if any, in front of it. For example, if the local name is lang and the namespace prefix is xml, the returned qualified name is xml:lang.
func (*BasicAttr) GetNextSibling ¶
func (node *BasicAttr) GetNextSibling() Node
Returns a Node representing the next node in the tree, or null if there isn't such node.
func (*BasicAttr) GetNodeName ¶
func (*BasicAttr) GetNodeType ¶
func (*BasicAttr) GetOwnerDocument ¶
func (node *BasicAttr) GetOwnerDocument() Document
Returns the Document that this node belongs to. If the node is itself a document, returns null.
func (*BasicAttr) GetOwnerElement ¶
The Element the attribute belongs to.
func (*BasicAttr) GetParentElement ¶
func (node *BasicAttr) GetParentElement() Element
Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.
func (*BasicAttr) GetParentNode ¶
func (node *BasicAttr) GetParentNode() Node
Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
func (*BasicAttr) GetPreviousSibling ¶
func (node *BasicAttr) GetPreviousSibling() Node
Returns a Node representing the previous node in the tree, or null if there isn't such node.
func (*BasicAttr) GetRootNode ¶
func (node *BasicAttr) GetRootNode() Node
func (*BasicAttr) GetValue ¶
The attribute's value, a string that can be set and get using this property.
func (*BasicAttr) HasChildNodes ¶
func (node *BasicAttr) HasChildNodes() bool
Returns a boolean value indicating whether or not the element has any child nodes.
func (*BasicAttr) InsertBefore ¶
func (*BasicAttr) IsDefaultNamespace ¶
Accepts a namespace URI as an argument and returns a boolean value with a value of true if the namespace is the default namespace on the given node or false if not.
func (*BasicAttr) IsEqualNode ¶
Returns a boolean value which indicates whether or not two nodes are of the same type and all their defining data points match.
func (*BasicAttr) IsSameNode ¶
Returns a boolean value indicating whether or not the two nodes are the same (that is, they reference the same object).
func (*BasicAttr) LookupNamespaceURI ¶
Accepts a prefix and returns the namespace URI associated with it on the given node if found (and "" if not). Supplying "" for the prefix will return the default namespace.
func (*BasicAttr) LookupPrefix ¶
Returns a string containing the prefix for a given namespace URI, if present, and "" if not. When multiple prefixes are possible, the result is implementation-dependent.
func (*BasicAttr) Normalize ¶
func (node *BasicAttr) Normalize()
Clean up all the text nodes under this element (merge adjacent, remove empty).
func (*BasicAttr) RemoveChild ¶
func (node *BasicAttr) RemoveChild(child Node)
Remove child from node
type BasicComment ¶
type BasicComment struct {
// contains filtered or unexported fields
}
func (*BasicComment) AppendChild ¶
func (*BasicComment) CloneNode ¶
func (cd *BasicComment) CloneNode(deep bool) Node
func (*BasicComment) GetNodeType ¶
func (cd *BasicComment) GetNodeType() NodeType
Returns COMMENT_NODE
func (*BasicComment) HasChildNodes ¶
func (cd *BasicComment) HasChildNodes() bool
func (*BasicComment) InsertBefore ¶
func (*BasicComment) IsEqualNode ¶
func (cd *BasicComment) IsEqualNode(node Node) bool
func (*BasicComment) IsSameNode ¶
func (cd *BasicComment) IsSameNode(node Node) bool
Returns a boolean value indicating whether or not the two nodes are the same (that is, they reference the same object).
func (*BasicComment) RemoveChild ¶
func (cs *BasicComment) RemoveChild(Node)
type BasicDocument ¶
type BasicDocument struct {
// contains filtered or unexported fields
}
BasicDocument implements DOM document
Implementation is guided by https://dom.spec.whatwg.org/
func (*BasicDocument) AdoptNode ¶
func (doc *BasicDocument) AdoptNode(node Node) Node
Adopt node from an external document.
func (*BasicDocument) AppendChild ¶
func (doc *BasicDocument) AppendChild(newNode Node) Node
Append newNode as a child of node
func (*BasicDocument) CloneNode ¶
func (doc *BasicDocument) CloneNode(deep bool) Node
Clone a Node, and optionally, all of its contents.
Returns the new Node cloned. The cloned node has no parent and is not part of the document, until it is added to another node that is part of the document, using Node.appendChild() or a similar method.
func (*BasicDocument) Contains ¶
Returns true or false value indicating whether or not a node is a descendant of the calling node.
func (*BasicDocument) CreateAttribute ¶
func (doc *BasicDocument) CreateAttribute(name string) Attr
Creates a new Attr object and returns it.
func (*BasicDocument) CreateAttributeNS ¶
func (doc *BasicDocument) CreateAttributeNS(prefix string, ns string, name string) Attr
Creates a new attribute node in a given namespace and returns it.
func (*BasicDocument) CreateComment ¶
func (doc *BasicDocument) CreateComment(text string) Comment
Creates a comment node.
func (*BasicDocument) CreateElement ¶
func (doc *BasicDocument) CreateElement(tag string) Element
Creates a new element with the given tag name.
func (*BasicDocument) CreateElementNS ¶
func (doc *BasicDocument) CreateElementNS(prefix string, ns string, tag string) Element
Creates a new element with the given tag name and namespace URI.
func (*BasicDocument) CreateProcessingInstruction ¶
func (doc *BasicDocument) CreateProcessingInstruction(target, data string) ProcessingInstruction
Creates a processing instruction node.
func (*BasicDocument) CreateTextNode ¶
func (doc *BasicDocument) CreateTextNode(text string) Text
Creates a text node.
func (*BasicDocument) GetChildNodes ¶
func (node *BasicDocument) GetChildNodes() NodeList
Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.
func (*BasicDocument) GetDocumentElement ¶
func (doc *BasicDocument) GetDocumentElement() Element
Returns the Element that is a direct child of the document.
func (*BasicDocument) GetDocumentType ¶
func (doc *BasicDocument) GetDocumentType() DocumentType
GetDocumentType returns the document type node
func (*BasicDocument) GetFirstChild ¶
func (node *BasicDocument) GetFirstChild() Node
Returns a Node representing the first direct child node of the node, or null if the node has no child.
func (*BasicDocument) GetLastChild ¶
func (node *BasicDocument) GetLastChild() Node
Returns a Node representing the last direct child node of the node, or null if the node has no child.
func (*BasicDocument) GetNextSibling ¶
func (node *BasicDocument) GetNextSibling() Node
Returns a Node representing the next node in the tree, or null if there isn't such node.
func (*BasicDocument) GetNodeName ¶
func (doc *BasicDocument) GetNodeName() string
Returns "#document"
func (*BasicDocument) GetNodeType ¶
func (doc *BasicDocument) GetNodeType() NodeType
Returns DOCUMENT_NODE
func (*BasicDocument) GetOwnerDocument ¶
func (node *BasicDocument) GetOwnerDocument() Document
Returns the Document that this node belongs to. If the node is itself a document, returns null.
func (*BasicDocument) GetParentElement ¶
func (node *BasicDocument) GetParentElement() Element
Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.
func (*BasicDocument) GetParentNode ¶
func (node *BasicDocument) GetParentNode() Node
Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
func (*BasicDocument) GetPreviousSibling ¶
func (node *BasicDocument) GetPreviousSibling() Node
Returns a Node representing the previous node in the tree, or null if there isn't such node.
func (*BasicDocument) GetRootNode ¶
func (node *BasicDocument) GetRootNode() Node
func (*BasicDocument) HasChildNodes ¶
func (node *BasicDocument) HasChildNodes() bool
Returns a boolean value indicating whether or not the element has any child nodes.
func (*BasicDocument) InsertBefore ¶
func (doc *BasicDocument) InsertBefore(newNode, referenceNode Node) Node
func (*BasicDocument) IsDefaultNamespace ¶
func (doc *BasicDocument) IsDefaultNamespace(uri string) bool
Accepts a namespace URI as an argument and returns a boolean value with a value of true if the namespace is the default namespace on the given node or false if not.
func (*BasicDocument) IsEqualNode ¶
func (doc *BasicDocument) IsEqualNode(node Node) bool
Returns a boolean value which indicates whether or not two nodes are of the same type and all their defining data points match.
func (*BasicDocument) IsSameNode ¶
func (doc *BasicDocument) IsSameNode(node Node) bool
Returns a boolean value indicating whether or not the two nodes are the same (that is, they reference the same object).
func (*BasicDocument) LookupNamespaceURI ¶
func (doc *BasicDocument) LookupNamespaceURI(prefix string) string
Accepts a prefix and returns the namespace URI associated with it on the given node if found (and "" if not).
func (*BasicDocument) LookupPrefix ¶
func (doc *BasicDocument) LookupPrefix(uri string) string
Returns a string containing the prefix for a given namespace URI, if present, and "" if not. When multiple prefixes are possible, the result is implementation-dependent.
func (*BasicDocument) Normalize ¶
func (doc *BasicDocument) Normalize()
Clean up all the text nodes under this element (merge adjacent, remove empty).
func (*BasicDocument) NormalizeNamespaces ¶
func (doc *BasicDocument) NormalizeNamespaces() error
NormalizeNamespaces assigns missing namespace prefixes
func (*BasicDocument) RemoveChild ¶
func (doc *BasicDocument) RemoveChild(child Node)
Remove child from node
type BasicDocumentType ¶
type BasicDocumentType struct {
// contains filtered or unexported fields
}
func (*BasicDocumentType) AppendChild ¶
Append newNode as a child of node
func (*BasicDocumentType) Contains ¶
Returns true or false value indicating whether or not a node is a descendant of the calling node.
func (*BasicDocumentType) GetChildNodes ¶
func (node *BasicDocumentType) GetChildNodes() NodeList
Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.
func (*BasicDocumentType) GetDefinition ¶
func (dt *BasicDocumentType) GetDefinition() string
func (*BasicDocumentType) GetFirstChild ¶
func (node *BasicDocumentType) GetFirstChild() Node
Returns a Node representing the first direct child node of the node, or null if the node has no child.
func (*BasicDocumentType) GetLastChild ¶
func (node *BasicDocumentType) GetLastChild() Node
Returns a Node representing the last direct child node of the node, or null if the node has no child.
func (*BasicDocumentType) GetName ¶
func (dt *BasicDocumentType) GetName() string
func (*BasicDocumentType) GetNextSibling ¶
func (node *BasicDocumentType) GetNextSibling() Node
Returns a Node representing the next node in the tree, or null if there isn't such node.
func (*BasicDocumentType) GetNodeName ¶
func (node *BasicDocumentType) GetNodeName() string
func (*BasicDocumentType) GetNodeType ¶
func (dt *BasicDocumentType) GetNodeType() NodeType
func (*BasicDocumentType) GetOwnerDocument ¶
func (node *BasicDocumentType) GetOwnerDocument() Document
Returns the Document that this node belongs to. If the node is itself a document, returns null.
func (*BasicDocumentType) GetParentElement ¶
func (node *BasicDocumentType) GetParentElement() Element
Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.
func (*BasicDocumentType) GetParentNode ¶
func (node *BasicDocumentType) GetParentNode() Node
Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
func (*BasicDocumentType) GetPreviousSibling ¶
func (node *BasicDocumentType) GetPreviousSibling() Node
Returns a Node representing the previous node in the tree, or null if there isn't such node.
func (*BasicDocumentType) GetPublicID ¶
func (dt *BasicDocumentType) GetPublicID() string
func (*BasicDocumentType) GetRootNode ¶
func (node *BasicDocumentType) GetRootNode() Node
func (*BasicDocumentType) GetSystemID ¶
func (dt *BasicDocumentType) GetSystemID() string
func (*BasicDocumentType) HasChildNodes ¶
func (node *BasicDocumentType) HasChildNodes() bool
Returns a boolean value indicating whether or not the element has any child nodes.
func (*BasicDocumentType) InsertBefore ¶
func (*BasicDocumentType) IsDefaultNamespace ¶
Accepts a namespace URI as an argument and returns a boolean value with a value of true if the namespace is the default namespace on the given node or false if not.
func (*BasicDocumentType) IsEqualNode ¶
func (*BasicDocumentType) IsSameNode ¶
func (*BasicDocumentType) LookupNamespaceURI ¶
Accepts a prefix and returns the namespace URI associated with it on the given node if found (and "" if not). Supplying "" for the prefix will return the default namespace.
func (*BasicDocumentType) LookupPrefix ¶
Returns a string containing the prefix for a given namespace URI, if present, and "" if not. When multiple prefixes are possible, the result is implementation-dependent.
func (*BasicDocumentType) Normalize ¶
func (node *BasicDocumentType) Normalize()
Clean up all the text nodes under this element (merge adjacent, remove empty).
func (*BasicDocumentType) RemoveChild ¶
func (node *BasicDocumentType) RemoveChild(child Node)
Remove child from node
type BasicElement ¶
type BasicElement struct {
// contains filtered or unexported fields
}
func (*BasicElement) AppendChild ¶
func (el *BasicElement) AppendChild(newNode Node) Node
Append newNode as a child of node
func (*BasicElement) CloneNode ¶
func (el *BasicElement) CloneNode(deep bool) Node
func (*BasicElement) Contains ¶
Returns true or false value indicating whether or not a node is a descendant of the calling node.
func (*BasicElement) GetAttribute ¶
func (el *BasicElement) GetAttribute(name string) (string, bool)
Retrieves the value of the named attribute from the current node and returns it as a string.
func (*BasicElement) GetAttributeNS ¶
func (el *BasicElement) GetAttributeNS(uri string, name string) (string, bool)
Retrieves the value of the attribute with the specified namespace and name from the current node and returns it as a string.
func (*BasicElement) GetAttributeNames ¶
func (el *BasicElement) GetAttributeNames() []string
Returns an array of attribute names from the current element.
func (*BasicElement) GetAttributeNode ¶
func (el *BasicElement) GetAttributeNode(name string) Attr
Retrieves the node representation of the named attribute from the current node and returns it as an Attr.
func (*BasicElement) GetAttributeNodeNS ¶
func (el *BasicElement) GetAttributeNodeNS(uri, name string) Attr
Retrieves the node representation of the attribute with the specified name and namespace, from the current node and returns it as an Attr.
func (*BasicElement) GetAttributes ¶
func (el *BasicElement) GetAttributes() NamedNodeMap
func (*BasicElement) GetChildNodes ¶
func (node *BasicElement) GetChildNodes() NodeList
Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.
func (*BasicElement) GetFirstChild ¶
func (node *BasicElement) GetFirstChild() Node
Returns a Node representing the first direct child node of the node, or null if the node has no child.
func (*BasicElement) GetFirstElementChild ¶
func (el *BasicElement) GetFirstElementChild() Element
func (*BasicElement) GetLastChild ¶
func (node *BasicElement) GetLastChild() Node
Returns a Node representing the last direct child node of the node, or null if the node has no child.
func (*BasicElement) GetLastElementChild ¶
func (el *BasicElement) GetLastElementChild() Element
func (*BasicElement) GetLocalName ¶
func (el *BasicElement) GetLocalName() string
A string representing the local part of the qualified name of the element.
func (*BasicElement) GetNextElementSibling ¶
func (el *BasicElement) GetNextElementSibling() Element
func (*BasicElement) GetNextSibling ¶
func (node *BasicElement) GetNextSibling() Node
Returns a Node representing the next node in the tree, or null if there isn't such node.
func (*BasicElement) GetNodeName ¶
func (el *BasicElement) GetNodeName() string
Returns HTML uppercased qualified name
func (*BasicElement) GetNodeType ¶
func (el *BasicElement) GetNodeType() NodeType
Returns ELEMENT_NODE
func (*BasicElement) GetOwnerDocument ¶
func (node *BasicElement) GetOwnerDocument() Document
Returns the Document that this node belongs to. If the node is itself a document, returns null.
func (*BasicElement) GetParentElement ¶
func (node *BasicElement) GetParentElement() Element
Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.
func (*BasicElement) GetParentNode ¶
func (node *BasicElement) GetParentNode() Node
Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
func (*BasicElement) GetPrefix ¶
func (el *BasicElement) GetPrefix() string
Returns a string representing the namespace prefix of the element, or "" if no prefix is specified.
func (*BasicElement) GetPreviousElementSibling ¶
func (el *BasicElement) GetPreviousElementSibling() Element
func (*BasicElement) GetPreviousSibling ¶
func (node *BasicElement) GetPreviousSibling() Node
Returns a Node representing the previous node in the tree, or null if there isn't such node.
func (*BasicElement) GetQName ¶
func (el *BasicElement) GetQName() Name
func (*BasicElement) GetRootNode ¶
func (node *BasicElement) GetRootNode() Node
func (*BasicElement) GetTagName ¶
func (el *BasicElement) GetTagName() string
Returns a String with the name of the tag for the given element.
func (*BasicElement) HasAttribute ¶
func (el *BasicElement) HasAttribute(name string) bool
Returns a boolean value indicating if the element has the specified attribute or not.
func (*BasicElement) HasAttributeNS ¶
func (el *BasicElement) HasAttributeNS(uri string, name string) bool
Returns a boolean value indicating if the element has the specified attribute, in the specified namespace, or not.
func (*BasicElement) HasChildNodes ¶
func (node *BasicElement) HasChildNodes() bool
Returns a boolean value indicating whether or not the element has any child nodes.
func (*BasicElement) InsertBefore ¶
func (el *BasicElement) InsertBefore(newNode, referenceNode Node) Node
func (*BasicElement) IsDefaultNamespace ¶
func (el *BasicElement) IsDefaultNamespace(uri string) bool
Accepts a namespace URI as an argument and returns a boolean value with a value of true if the namespace is the default namespace on the given node or false if not.
func (*BasicElement) IsEqualNode ¶
func (el *BasicElement) IsEqualNode(node Node) bool
func (*BasicElement) IsSameNode ¶
func (el *BasicElement) IsSameNode(node Node) bool
Returns a boolean value indicating whether or not the two nodes are the same (that is, they reference the same object).
func (*BasicElement) LookupNamespaceURI ¶
func (el *BasicElement) LookupNamespaceURI(prefix string) string
Accepts a prefix and returns the namespace URI associated with it on the given node if found (and "" if not). Supplying "" for the prefix will return the default namespace.
func (*BasicElement) LookupPrefix ¶
func (el *BasicElement) LookupPrefix(uri string) string
Returns a string containing the prefix for a given namespace URI, if present, and "" if not. When multiple prefixes are possible, the result is implementation-dependent.
func (*BasicElement) Normalize ¶
func (el *BasicElement) Normalize()
func (*BasicElement) Remove ¶
func (el *BasicElement) Remove()
Removes the element from the children list of its parent.
func (*BasicElement) RemoveAttribute ¶
func (el *BasicElement) RemoveAttribute(name string)
Removes the named attribute from the current node.
func (*BasicElement) RemoveAttributeNS ¶
func (el *BasicElement) RemoveAttributeNS(uri string, name string)
Removes the attribute with the specified name and namespace, from the current node.
func (*BasicElement) RemoveAttributeNode ¶
func (el *BasicElement) RemoveAttributeNode(attr Attr)
Removes the node representation of the named attribute from the current node.
func (*BasicElement) RemoveChild ¶
func (el *BasicElement) RemoveChild(child Node)
Remove child from node
func (*BasicElement) SetAttribute ¶
func (el *BasicElement) SetAttribute(name string, value string)
Sets the value of a named attribute of the current node.
func (*BasicElement) SetAttributeNS ¶
func (el *BasicElement) SetAttributeNS(prefix, uri, name string, value string)
Sets the value of the attribute with the specified name and namespace, from the current node.
func (*BasicElement) SetAttributeNode ¶
func (el *BasicElement) SetAttributeNode(attr Attr)
Sets the node representation of the named attribute from the current node.
func (*BasicElement) SetAttributeNodeNS ¶
func (el *BasicElement) SetAttributeNodeNS(attr Attr)
Sets the node representation of the attribute with the specified name and namespace, from the current node.
type BasicNamedNodeMap ¶
type BasicNamedNodeMap struct {
// contains filtered or unexported fields
}
func (*BasicNamedNodeMap) GetLength ¶
func (b *BasicNamedNodeMap) GetLength() int
func (*BasicNamedNodeMap) GetNamedItemNS ¶
func (b *BasicNamedNodeMap) GetNamedItemNS(uri string, name string) Attr
Returns a Attr identified by a namespace and related local name.
func (*BasicNamedNodeMap) Item ¶
func (b *BasicNamedNodeMap) Item(i int) Attr
Returns the Attr at the given index, or null if the index is higher or equal to the number of nodes
func (*BasicNamedNodeMap) RemoveNamedItemNS ¶
func (b *BasicNamedNodeMap) RemoveNamedItemNS(uri string, name string)
func (*BasicNamedNodeMap) SetNamedItemNS ¶
func (b *BasicNamedNodeMap) SetNamedItemNS(a Attr)
Replaces, or adds, the Attr identified in the map by the given namespace and related local name.
type BasicNodeList ¶
type BasicNodeList struct {
// contains filtered or unexported fields
}
func (*BasicNodeList) GetLength ¶
func (list *BasicNodeList) GetLength() int
func (*BasicNodeList) Item ¶
func (list *BasicNodeList) Item(i int) Node
type BasicProcessingInstruction ¶
type BasicProcessingInstruction struct {
// contains filtered or unexported fields
}
func (*BasicProcessingInstruction) AppendChild ¶
func (*BasicProcessingInstruction) CloneNode ¶
func (p *BasicProcessingInstruction) CloneNode(deep bool) Node
func (*BasicProcessingInstruction) GetNodeName ¶
func (p *BasicProcessingInstruction) GetNodeName() string
Returns target
func (*BasicProcessingInstruction) GetNodeType ¶
func (p *BasicProcessingInstruction) GetNodeType() NodeType
Returns PROCESSING_INSTRUCTION_NODE
func (*BasicProcessingInstruction) GetTarget ¶
func (p *BasicProcessingInstruction) GetTarget() string
func (*BasicProcessingInstruction) GetValue ¶
func (cd *BasicProcessingInstruction) GetValue() string
func (*BasicProcessingInstruction) HasChildNodes ¶
func (cd *BasicProcessingInstruction) HasChildNodes() bool
func (*BasicProcessingInstruction) InsertBefore ¶
func (*BasicProcessingInstruction) IsEqualNode ¶
func (p *BasicProcessingInstruction) IsEqualNode(node Node) bool
func (*BasicProcessingInstruction) IsSameNode ¶
func (p *BasicProcessingInstruction) IsSameNode(node Node) bool
Returns a boolean value indicating whether or not the two nodes are the same (that is, they reference the same object).
func (*BasicProcessingInstruction) RemoveChild ¶
func (cs *BasicProcessingInstruction) RemoveChild(Node)
func (*BasicProcessingInstruction) SetTarget ¶
func (p *BasicProcessingInstruction) SetTarget(t string)
type BasicText ¶
type BasicText struct {
// contains filtered or unexported fields
}
func (*BasicText) AppendChild ¶
func (*BasicText) HasChildNodes ¶
func (cd *BasicText) HasChildNodes() bool
func (*BasicText) InsertBefore ¶
func (*BasicText) IsEqualNode ¶
func (*BasicText) IsSameNode ¶
Returns a boolean value indicating whether or not the two nodes are the same (that is, they reference the same object).
func (*BasicText) RemoveChild ¶
func (cs *BasicText) RemoveChild(Node)
type CharacterData ¶
type Comment ¶
type Comment interface { CharacterData }
type Document ¶
type Document interface { Node // Returns the Element that is a direct child of the document. GetDocumentElement() Element // Creates a new Attr object and returns it. CreateAttribute(string) Attr // Creates a new attribute node in a given namespace and returns it. CreateAttributeNS(prefix string, ns string, name string) Attr // Creates a new comment node and returns it. CreateComment(string) Comment // Creates a new element with the given tag name. CreateElement(string) Element // Creates a new element with the given tag name and namespace URI. CreateElementNS(prefix string, ns string, tag string) Element // Creates a text node. CreateTextNode(string) Text //Creates a new ProcessingInstruction object. CreateProcessingInstruction(target, data string) ProcessingInstruction // Assigns missing namespace prefixes, resolve prefix clashes etc. NormalizeNamespaces() error // Adopt node from an external document. AdoptNode(Node) Node // Return the document type node GetDocumentType() DocumentType }
func NewDocument ¶
func NewDocument() Document
type DocumentType ¶
type DocumentType interface { Node GetName() string GetPublicID() string GetSystemID() string GetDefinition() string }
func ParseDocumentType ¶
func ParseDocumentType(content []byte) (DocumentType, bool, error)
ParseDocumentType parses a document type starting with <!DOCTYPE ... If the input is not a doctype, returns nil,false,nil
type Element ¶
type Element interface { Node GetAttributes() NamedNodeMap // Returns a String with the name of the tag for the given element. GetTagName() string // GetQName returns the qualified name GetQName() Name // Returns a string representing the namespace prefix of the element, // or "" if no prefix is specified. GetPrefix() string // A string representing the local part of the qualified name of the // element. GetLocalName() string GetFirstElementChild() Element GetLastElementChild() Element GetNextElementSibling() Element GetPreviousElementSibling() Element // Retrieves the value of the named attribute from the current node // and returns it as a string. GetAttribute(string) (string, bool) // Returns an array of attribute names from the current element. GetAttributeNames() []string // Retrieves the node representation of the named attribute from the // current node and returns it as an Attr. GetAttributeNode(string) Attr // Retrieves the node representation of the attribute with the // specified name and namespace, from the current node and returns // it as an Attr. GetAttributeNodeNS(uri, name string) Attr // Retrieves the value of the attribute with the specified // namespace and name from the current node and returns it as a // string. GetAttributeNS(uri string, name string) (string, bool) // Returns a boolean value indicating if the element has the // specified attribute or not. HasAttribute(string) bool // Removes the element from the children list of its parent. Remove() // Removes the named attribute from the current node. RemoveAttribute(string) // Removes the node representation of the named attribute from the // current node. RemoveAttributeNode(Attr) // Removes the attribute with the specified name and namespace, from // the current node. RemoveAttributeNS(uri string, name string) // Sets the value of a named attribute of the current node. SetAttribute(name string, value string) // Sets the node representation of the named attribute from the // current node. SetAttributeNode(attr Attr) // Sets the value of the attribute with the specified name and // namespace, from the current node. SetAttributeNS(prefix, uri, name string, value string) }
type ErrDOM ¶
func ErrHierarchyRequest ¶
type NamedNodeMap ¶
type NamedNodeMap interface { GetLength() int // Returns the Attr at the given index, or null if the index is higher or equal to the number of nodes Item(int) Attr // Returns a Attr identified by a namespace and related local name. GetNamedItemNS(uri, name string) Attr // Replaces, or adds, the Attr identified in the map by the given namespace and related local name. SetNamedItemNS(Attr) RemoveNamedItemNS(uri string, name string) }
type Node ¶
type Node interface { // Returns a live NodeList containing all the children of this node // (including elements, text and comments). NodeList being live means // that if the children of the Node change, the NodeList object is // automatically updated. GetChildNodes() NodeList // Returns a Node representing the first direct child node of the // node, or null if the node has no child. GetFirstChild() Node // Returns a Node representing the last direct child node of the node, // or null if the node has no child. GetLastChild() Node // Returns a Node representing the next node in the tree, or null if // there isn't such node. GetNextSibling() Node // Returns a String containing the name of the Node. The structure of // the name will differ with the node type. E.g. An HTMLElement will // contain the name of the corresponding tag, like 'audio' for an // HTMLAudioElement, a Text node will have the '#text' string, or a // Document node will have the '#document' string. GetNodeName() string // Returns an unsigned short representing the type of the // node. GetNodeType() NodeType // Returns the Document that this node belongs to. If the node is // itself a document, returns null. GetOwnerDocument() Document // Returns a Node that is the parent of this node. If there is no such // node, like if this node is the top of the tree or if doesn't // participate in a tree, this property returns null. GetParentNode() Node // Returns an Element that is the parent of this node. If the node has // no parent, or if that parent is not an Element, this property // returns null. GetParentElement() Element // Returns a Node representing the previous node in the tree, or null // if there isn't such node. GetPreviousSibling() Node // Adds the specified childNode argument as the last child to the // current node. If the argument referenced an existing node on the // DOM tree, the node will be detached from its current position and // attached at the new position. // // Returns a Node that is the appended child (aChild), except when aChild // is a DocumentFragment, in which case the empty DocumentFragment // is returned. AppendChild(Node) Node // Returns a boolean value indicating whether or not the element has // any child nodes. HasChildNodes() bool // Return node. InsertBefore(newNode, referenceNode Node) Node // Removes a child node from the current element, which must be a // child of the current node. RemoveChild(Node) // Clone a Node, and optionally, all of its contents. // // Returns the new Node cloned. The cloned node has no parent and is not // part of the document, until it is added to another node that is // part of the document, using Node.appendChild() or a similar // method. CloneNode(deep bool) Node // Returns true or false value indicating whether or not a node is a // descendant of the calling node. Contains(Node) bool // Returns the object's root GetRootNode() Node // Accepts a namespace URI as an argument and returns a boolean value // with a value of true if the namespace is the default namespace on // the given node or false if not. IsDefaultNamespace(uri string) bool // Returns a boolean value which indicates whether or not two nodes // are of the same type and all their defining data points match. IsEqualNode(Node) bool // Returns a boolean value indicating whether or not the two nodes are // the same (that is, they reference the same object). IsSameNode(Node) bool // Returns a string containing the prefix for a given namespace // URI, if present, and "" if not. When multiple prefixes are // possible, the result is implementation-dependent. LookupPrefix(string) string // Accepts a prefix and returns the namespace URI associated with it // on the given node if found (and "" if not). LookupNamespaceURI(string) string // Clean up all the text nodes under this element (merge adjacent, // remove empty). Normalize() // contains filtered or unexported methods }
type NodeType ¶
type NodeType uint
const ATTRIBUTE_NODE NodeType = 2
const CDATA_SECTION_NODE NodeType = 4
const COMMENT_NODE NodeType = 8
const DOCUMENT_FRAGMENT_NODE NodeType = 11
const DOCUMENT_NODE NodeType = 9
const DOCUMENT_TYPE_NODE NodeType = 10
const ELEMENT_NODE NodeType = 1
const PROCESSING_INSTRUCTION_NODE NodeType = 7
const TEXT_NODE NodeType = 3
type ProcessingInstruction ¶
type ProcessingInstruction interface { CharacterData GetTarget() string SetTarget(string) }
type Text ¶
type Text interface { CharacterData }