xquery

package
v0.0.0-...-b6e392a Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidXML = errors.New("data is not in xml format")

Functions

This section is empty.

Types

type XML

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

XML is a wrapper of xmlquery.XML. It has additional safety incorporated when querying the contents. This also serves as an abstraction from real implementation which can change. In fact library was changed, this should limit disruption in the future if such issue arises again.

func NewXML

func NewXML(data []byte) (*XML, error)

func (*XML) Attr

func (x *XML) Attr(name string) string

func (*XML) FindMany

func (x *XML) FindMany(expr string) (output []*XML)

func (*XML) FindOne

func (x *XML) FindOne(expr string) (output *XML)

func (*XML) GetChild

func (x *XML) GetChild() *XML

func (*XML) GetChildren

func (x *XML) GetChildren() []*XML

func (*XML) HasChildren

func (x *XML) HasChildren() bool

func (*XML) IsEmpty

func (x *XML) IsEmpty() bool

func (*XML) Parent

func (x *XML) Parent() *XML

func (*XML) RawXML

func (x *XML) RawXML() string

RawXML returns raw data of the whole XML node.

func (*XML) SetDataNode

func (x *XML) SetDataNode(node *XML) bool

SetDataNode will attach tree found under the node to current xml as a First element. If this xml object cannot accept then nodes nothing happens. Returns true if set operation was successful.

func (*XML) SetDataText

func (x *XML) SetDataText(data string)

SetDataText verifies that data type matches the type of xml Node. Changes text.

func (*XML) Text

func (x *XML) Text() string

Text provides inner text of this node.

Jump to

Keyboard shortcuts

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