xmlnode

package
v0.0.0-...-c3cacf9 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elem

type Elem interface {
	Node
	//GetChildren returns the elements children.
	GetChildren() []Node
	//GetAttrs returns the attributes of the element
	GetAttrs() []Node
}

Elem is a XPath result that is an element node

type NSElem

type NSElem interface {
	Elem
	GetNS() map[xml.Name]string
}

NSElem is a node that keeps track of namespaces.

type Node

type Node interface {
	//ResValue prints the node's string value
	ResValue() string
	//Pos returns the node's position in the document order
	Pos() int
	//GetToken returns the xml.Token representation of the node
	GetToken() xml.Token
	//GetParent returns the parent node, which will always be an XML element
	GetParent() Elem
	//GetNodeType returns the node's type
	GetNodeType() tree.NodeType
}

Node is a XPath result that is a node except elements

type XMLNode

type XMLNode struct {
	xml.Token
	tree.NodeType
	Parent   Elem
	Position int
}

XMLNode will represent an attribute, character data, comment, or processing instruction node

func (XMLNode) GetNodeType

func (a XMLNode) GetNodeType() tree.NodeType

GetNodeType returns the node type

func (XMLNode) GetParent

func (a XMLNode) GetParent() Elem

GetParent returns the parent node

func (XMLNode) GetToken

func (a XMLNode) GetToken() xml.Token

GetToken returns the xml.Token representation of the node

func (XMLNode) Pos

func (a XMLNode) Pos() int

Pos returns node position

func (XMLNode) ResValue

func (a XMLNode) ResValue() string

ResValue returns the string value of the attribute

Jump to

Keyboard shortcuts

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