dom

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDocument

func NewDocument(name string, opts data.DOMOption) data.Document

func NewDocumentNS

func NewDocumentNS(name, ns string, opts data.DOMOption) data.Document

func Read

func Read(r io.Reader, opts data.DOMOption) (data.Document, error)

Types

type Comment

type Comment struct {
	Node
	// contains filtered or unexported fields
}

func NewComment

func NewComment(cdata []byte, parent *Element, document *Document) *Comment

func (*Comment) Cdata

func (this *Comment) Cdata() string

func (*Comment) MarshalXML

func (this *Comment) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

func (*Comment) String

func (this *Comment) String() string

type Document

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

func (*Document) CreateComment

func (this *Document) CreateComment(cdata string) data.Node

func (*Document) CreateElement

func (this *Document) CreateElement(name string) data.Node

func (*Document) CreateElementNS

func (this *Document) CreateElementNS(name, ns string) data.Node

func (*Document) CreateText

func (this *Document) CreateText(cdata string) data.Node

func (*Document) GetElementById

func (this *Document) GetElementById(value string) data.Node

func (*Document) GetElementByIdNS

func (this *Document) GetElementByIdNS(value, ns string) data.Node

func (*Document) String

func (this *Document) String() string

func (*Document) UnmarshalXML

func (this *Document) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

func (*Document) Write

func (this *Document) Write(w io.Writer) error

type Element

type Element struct {
	Node
	XMLName xml.Name
	// contains filtered or unexported fields
}

func NewElementNS

func NewElementNS(name, ns string, parent *Element, document *Document) *Element

func (*Element) AddChild

func (this *Element) AddChild(child data.Node) error

func (*Element) Attr

func (this *Element) Attr(name string) (xml.Attr, bool)

func (*Element) AttrNS

func (this *Element) AttrNS(name, ns string) (xml.Attr, bool)

func (*Element) Attrs

func (this *Element) Attrs() []xml.Attr

func (*Element) Children

func (this *Element) Children() []data.Node

func (*Element) FirstChild

func (this *Element) FirstChild() data.Node

func (*Element) GetElementsByTagName

func (this *Element) GetElementsByTagName(name string) []data.Node

func (*Element) GetElementsByTagNameNS

func (this *Element) GetElementsByTagNameNS(name, ns string) []data.Node

func (*Element) InsertChildBefore

func (this *Element) InsertChildBefore(child, ref data.Node) error

func (*Element) LastChild

func (this *Element) LastChild() data.Node

func (*Element) MarshalXML

func (this *Element) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

func (*Element) Name

func (this *Element) Name() xml.Name

func (*Element) RemoveAllChildren

func (this *Element) RemoveAllChildren() error

func (*Element) RemoveChild

func (this *Element) RemoveChild(child data.Node) error

func (*Element) SetAttr

func (this *Element) SetAttr(name string, value string) error

func (*Element) SetAttrNS

func (this *Element) SetAttrNS(name, ns string, value string) error

func (*Element) String

func (this *Element) String() string

type Node

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

func (*Node) AddChild

func (this *Node) AddChild(child data.Node) error

func (*Node) Attr

func (this *Node) Attr(string) (xml.Attr, bool)

func (*Node) AttrNS

func (this *Node) AttrNS(string, string) (xml.Attr, bool)

func (*Node) Attrs

func (this *Node) Attrs() []xml.Attr

func (*Node) Cdata

func (this *Node) Cdata() string

func (*Node) Children

func (this *Node) Children() []data.Node

func (*Node) Document

func (this *Node) Document() data.Document

func (*Node) FirstChild

func (this *Node) FirstChild() data.Node

func (*Node) GetElementsByTagName

func (this *Node) GetElementsByTagName(name string) []data.Node

func (*Node) GetElementsByTagNameNS

func (this *Node) GetElementsByTagNameNS(string, string) []data.Node

func (*Node) InsertChildBefore

func (this *Node) InsertChildBefore(node, ref data.Node) error

func (*Node) LastChild

func (this *Node) LastChild() data.Node

func (*Node) Name

func (this *Node) Name() xml.Name

func (*Node) Parent

func (this *Node) Parent() data.Node

func (*Node) RemoveChild

func (this *Node) RemoveChild(child data.Node) error

func (*Node) RemoveChildren

func (this *Node) RemoveChildren() error

func (*Node) SetAttr

func (this *Node) SetAttr(name string, value string) error

func (*Node) SetAttrNS

func (this *Node) SetAttrNS(string, string, string) error

type Text

type Text struct {
	Node
	// contains filtered or unexported fields
}

func NewText

func NewText(cdata []byte, parent *Element, document *Document) *Text

func (*Text) Cdata

func (this *Text) Cdata() string

func (*Text) MarshalXML

func (this *Text) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

func (*Text) String

func (this *Text) String() string

Jump to

Keyboard shortcuts

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