dom

package module
v0.0.0-...-d476785 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2015 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ELEMENT_NODE = iota
	ATTRIBUTE_NODE
	TEXT_NODE
	CDATA_SECTION_NODE
	ENTITY_REFERENCE_NODE
	ENTITY_NODE
	PROCESSING_INSTRUCTION_NODE
	COMMENT_NODE
	DOCUMENT_NODE
	DOCUMENT_TYPE_NODE
	DOCUMENT_FRAGMENT_NODE
	NOTATION_NODE
)
View Source
const (
	DEBUG = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr interface {
	Node
	OwnerDocument() *Document
}

http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-637646024

type CharacterData

type CharacterData struct {
	// contains filtered or unexported fields
}

func (*CharacterData) AppendChild

func (n *CharacterData) AppendChild(c Node) Node

func (*CharacterData) AppendData

func (n *CharacterData) AppendData(data string)

func (*CharacterData) Attributes

func (n *CharacterData) Attributes() NamedNodeMap

func (*CharacterData) ChildNodes

func (n *CharacterData) ChildNodes() NodeList

func (*CharacterData) Data

func (n *CharacterData) Data() string

func (*CharacterData) DeleteData

func (n *CharacterData) DeleteData(offset, count uint32)

func (*CharacterData) EscapedBytes

func (n *CharacterData) EscapedBytes() []byte

func (*CharacterData) FirstChild

func (p *CharacterData) FirstChild() Node

func (*CharacterData) HasChildNodes

func (n *CharacterData) HasChildNodes() (b bool)

func (*CharacterData) InsertBefore

func (p *CharacterData) InsertBefore(newChild Node, refChild Node) Node

func (*CharacterData) InsertData

func (n *CharacterData) InsertData(offset uint32, data string)

func (*CharacterData) LastChild

func (p *CharacterData) LastChild() Node

func (*CharacterData) Length

func (n *CharacterData) Length() uint32

func (*CharacterData) NextSibling

func (n *CharacterData) NextSibling() Node

func (*CharacterData) NodeName

func (n *CharacterData) NodeName() (s string)

func (*CharacterData) NodeType

func (n *CharacterData) NodeType() uint

func (*CharacterData) NodeValue

func (n *CharacterData) NodeValue() (s string)

func (*CharacterData) OwnerDocument

func (n *CharacterData) OwnerDocument() *Document

func (*CharacterData) ParentNode

func (n *CharacterData) ParentNode() Node

func (*CharacterData) PreviousSibling

func (n *CharacterData) PreviousSibling() Node

func (*CharacterData) RemoveChild

func (n *CharacterData) RemoveChild(c Node) Node

func (*CharacterData) ReplaceChild

func (p *CharacterData) ReplaceChild(nc Node, rc Node) Node

func (*CharacterData) ReplaceData

func (n *CharacterData) ReplaceData(offset, count uint32, data string)

func (*CharacterData) SetData

func (n *CharacterData) SetData(s string)

func (*CharacterData) String

func (n *CharacterData) String() string

func (*CharacterData) SubstringData

func (n *CharacterData) SubstringData(offset uint32, count uint32) string

func (*CharacterData) TagName

func (n *CharacterData) TagName() string

type Comment

type Comment struct {
	CharacterData
}

func (*Comment) AppendChild

func (n *Comment) AppendChild(c Node) Node

func (*Comment) Attributes

func (n *Comment) Attributes() NamedNodeMap

func (*Comment) ChildNodes

func (n *Comment) ChildNodes() NodeList

func (*Comment) FirstChild

func (p *Comment) FirstChild() Node

func (*Comment) HasChildNodes

func (n *Comment) HasChildNodes() (b bool)

func (*Comment) InsertBefore

func (p *Comment) InsertBefore(newChild Node, refChild Node) Node

func (*Comment) LastChild

func (p *Comment) LastChild() Node

func (*Comment) NextSibling

func (n *Comment) NextSibling() Node

func (*Comment) NodeName

func (n *Comment) NodeName() (s string)

func (*Comment) NodeType

func (n *Comment) NodeType() uint

func (*Comment) NodeValue

func (n *Comment) NodeValue() (s string)

func (*Comment) OwnerDocument

func (n *Comment) OwnerDocument() *Document

func (*Comment) ParentNode

func (n *Comment) ParentNode() Node

func (*Comment) PreviousSibling

func (n *Comment) PreviousSibling() Node

func (*Comment) RemoveChild

func (n *Comment) RemoveChild(c Node) Node

func (*Comment) ReplaceChild

func (p *Comment) ReplaceChild(nc Node, rc Node) Node

func (*Comment) TagName

func (n *Comment) TagName() string

type Document

type Document struct {
	// contains filtered or unexported fields
}

DOM3: http://www.w3.org/TR/DOM-Level-3-Core/core.html#i-Document

func Parse

func Parse(r io.Reader, strict bool, autoClose []string, entity map[string]string) (doc *Document, err error)

func ParseHtml

func ParseHtml(r io.Reader) (doc *Document, err error)

func ParseString

func ParseString(s string, strict bool, autoClose []string, entity map[string]string) (doc *Document, err error)

func ParseStringHtml

func ParseStringHtml(s string) (doc *Document, err error)

func ParseStringXml

func ParseStringXml(s string) (doc *Document, err error)

func ParseXml

func ParseXml(r io.Reader) (doc *Document, err error)

func (*Document) AppendChild

func (d *Document) AppendChild(c Node) Node

func (*Document) Attributes

func (n *Document) Attributes() NamedNodeMap

func (*Document) ChildNodes

func (n *Document) ChildNodes() NodeList

func (*Document) CreateComment

func (d *Document) CreateComment(text string) *Comment

func (*Document) CreateElement

func (d *Document) CreateElement(tag string) *Element

func (*Document) CreateTextNode

func (d *Document) CreateTextNode(text string) *Text

func (*Document) DocumentElement

func (d *Document) DocumentElement() *Element

func (*Document) FirstChild

func (p *Document) FirstChild() Node

func (*Document) GetElementById

func (d *Document) GetElementById(id string) *Element

DOM Level 2

func (*Document) HasChildNodes

func (n *Document) HasChildNodes() (b bool)

func (*Document) InsertBefore

func (p *Document) InsertBefore(newChild Node, refChild Node) Node

func (*Document) LastChild

func (p *Document) LastChild() Node

func (*Document) NextSibling

func (n *Document) NextSibling() Node

func (*Document) NodeName

func (d *Document) NodeName() string

func (*Document) NodeType

func (d *Document) NodeType() uint

func (*Document) NodeValue

func (d *Document) NodeValue() string

func (*Document) OwnerDocument

func (d *Document) OwnerDocument() *Document

func (*Document) ParentNode

func (n *Document) ParentNode() Node

func (*Document) PreviousSibling

func (n *Document) PreviousSibling() Node

func (*Document) RemoveChild

func (d *Document) RemoveChild(c Node) Node

func (*Document) ReplaceChild

func (p *Document) ReplaceChild(nc Node, rc Node) Node

func (*Document) TagName

func (n *Document) TagName() string

func (*Document) ToText

func (doc *Document) ToText(escape bool) []byte

func (*Document) ToXml

func (doc *Document) ToXml() []byte

Custom routines solely for golang

type Element

type Element struct {
	// contains filtered or unexported fields
}

DOM3: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-745549614

func (*Element) AppendChild

func (n *Element) AppendChild(c Node) Node

func (*Element) Attributes

func (n *Element) Attributes() NamedNodeMap

func (*Element) ChildNodes

func (n *Element) ChildNodes() NodeList

func (*Element) FirstChild

func (p *Element) FirstChild() Node

func (*Element) GetAttribute

func (n *Element) GetAttribute(name string) string

func (*Element) GetElementById

func (e *Element) GetElementById(id string) *Element

func (*Element) GetElementsByTagName

func (n *Element) GetElementsByTagName(name string) NodeList

func (*Element) HasChildNodes

func (n *Element) HasChildNodes() (b bool)

func (*Element) InsertBefore

func (p *Element) InsertBefore(newChild Node, refChild Node) Node

func (*Element) LastChild

func (p *Element) LastChild() Node

func (*Element) NextSibling

func (n *Element) NextSibling() Node

func (*Element) NodeName

func (n *Element) NodeName() string

func (*Element) NodeType

func (e *Element) NodeType() uint

func (*Element) NodeValue

func (n *Element) NodeValue() string

func (*Element) OwnerDocument

func (n *Element) OwnerDocument() *Document

func (*Element) ParentNode

func (n *Element) ParentNode() Node

func (*Element) PreviousSibling

func (n *Element) PreviousSibling() Node

func (*Element) RemoveChild

func (n *Element) RemoveChild(c Node) Node

func (*Element) ReplaceChild

func (p *Element) ReplaceChild(nc Node, rc Node) Node

func (*Element) SetAttribute

func (n *Element) SetAttribute(attrname string, attrval string)

func (*Element) TagName

func (n *Element) TagName() string

func (*Element) ToText

func (n *Element) ToText(escape bool) []byte

func (*Element) ToXml

func (n *Element) ToXml() []byte

Custom routines solely for golang

type NamedNodeMap

type NamedNodeMap interface {
	Length() uint
	Item(index uint) Node
}

http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1780488922

type Node

type Node interface {
	AppendChild(Node) Node
	RemoveChild(Node) Node
	InsertBefore(Node, Node) Node
	ReplaceChild(Node, Node) Node
	// attributes
	NodeName() string
	NodeValue() string
	NodeType() uint
	ParentNode() Node
	ChildNodes() NodeList
	Attributes() NamedNodeMap
	HasChildNodes() bool
	FirstChild() Node
	LastChild() Node
	PreviousSibling() Node
	NextSibling() Node
	// contains filtered or unexported methods
}

DOM3: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247

type NodeList

type NodeList interface {
	Length() uint
	Item(index uint) Node
}

DOM3: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-536297177

type SyntaxError

type SyntaxError struct {
	Msg string
}

func (*SyntaxError) Error

func (se *SyntaxError) Error() string

type Text

type Text struct {
	CharacterData
}

func (*Text) AppendChild

func (n *Text) AppendChild(c Node) Node

func (*Text) Attributes

func (n *Text) Attributes() NamedNodeMap

func (*Text) ChildNodes

func (n *Text) ChildNodes() NodeList

func (*Text) FirstChild

func (p *Text) FirstChild() Node

func (*Text) HasChildNodes

func (n *Text) HasChildNodes() (b bool)

func (*Text) InsertBefore

func (p *Text) InsertBefore(newChild Node, refChild Node) Node

func (*Text) LastChild

func (p *Text) LastChild() Node

func (*Text) NextSibling

func (n *Text) NextSibling() Node

func (*Text) NodeName

func (n *Text) NodeName() (s string)

func (*Text) NodeType

func (n *Text) NodeType() uint

func (*Text) NodeValue

func (n *Text) NodeValue() (s string)

func (*Text) OwnerDocument

func (n *Text) OwnerDocument() *Document

func (*Text) ParentNode

func (n *Text) ParentNode() Node

func (*Text) PreviousSibling

func (n *Text) PreviousSibling() Node

func (*Text) RemoveChild

func (n *Text) RemoveChild(c Node) Node

func (*Text) ReplaceChild

func (p *Text) ReplaceChild(nc Node, rc Node) Node

func (*Text) TagName

func (n *Text) TagName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL