dom

package module
v0.0.0-...-76e3980 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2013 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ELEMENT_NODE = iota + 1
	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

func ToXml

func ToXml(doc Document) string

Types

type Attr

type Attr interface {
	Node
	OwnerDocument() Document
	Name() string
	GetValue() string
	SetValue(string)
	// DOM Level 2
	OwnerElement() Element
}

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

type CharacterData

type CharacterData interface {
	Node
	Length() uint32
	GetData() string
	SetData(string)
}

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

type Document

type Document interface {
	Node
	DocumentElement() Element
	CreateElement(tagName string) Element
	CreateTextNode(data string) Text
	CreateAttribute(name string) Attr
	OwnerDocument() Document
	// DOM Level 2
	GetElementById(id string) Element
	GetElementsByTagName(name string) NodeList
}

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

func Parse

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

func ParseString

func ParseString(s string) (doc Document, err error)

type Element

type Element interface {
	Node
	TagName() string
	GetAttribute(name string) string
	GetAttributeNode(name string) Attr
	SetAttribute(name string, value string)
	SetAttributeNode(newAttr Attr) Attr
	RemoveAttribute(name string)
	RemoveAttributeNode(oldAttr Attr) Attr
	OwnerDocument() Document
	GetElementsByTagName(name string) NodeList
	HasAttribute(name string) bool
}

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

type NamedNodeMap

type NamedNodeMap interface {
	Length() uint
	Item(index uint) Node
	GetNamedItem(name string) Node
	SetNamedItem(arg Node) Node
	RemoveNamedItem(name string) 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
}

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

type NodeList

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

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

Jump to

Keyboard shortcuts

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