xmlele

package
v0.0.0-...-97928f7 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Root

func Root() xmlbuilder.XMLBuilder

Root is the default root node builder for xmltree.ParseXML

Types

type XMLEle

type XMLEle struct {
	xml.StartElement
	tree.NSBuilder
	Attrs    []tree.Node
	Children []tree.Node
	Parent   tree.Elem
	tree.NodePos
	tree.NodeType
}

XMLEle is an implementation of XPRes for XML elements

func (*XMLEle) CreateNode

func (x *XMLEle) CreateNode(opts *xmlbuilder.BuilderOpts) xmlbuilder.XMLBuilder

CreateNode is an implementation of xmlbuilder.XMLBuilder. It appends the node specified in opts and returns the child if it is an element. Otherwise, it returns x.

func (*XMLEle) EndElem

func (x *XMLEle) EndElem() xmlbuilder.XMLBuilder

EndElem is an implementation of xmlbuilder.XMLBuilder. It returns x's parent.

func (*XMLEle) GetAttrs

func (x *XMLEle) GetAttrs() []tree.Node

GetAttrs returns all attributes of the element

func (*XMLEle) GetChildren

func (x *XMLEle) GetChildren() []tree.Node

GetChildren returns all child nodes of the element

func (*XMLEle) GetParent

func (x *XMLEle) GetParent() tree.Elem

GetParent returns the parent node, or itself if it's the root

func (*XMLEle) GetToken

func (x *XMLEle) GetToken() xml.Token

GetToken returns the xml.Token representation of the node

func (*XMLEle) ResValue

func (x *XMLEle) ResValue() string

ResValue returns the string value of the element and children

Jump to

Keyboard shortcuts

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