xmlnode

package
v0.0.0-...-60c6a2d Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type XmlNode

type XmlNode struct {
	XMLName    xml.Name
	Attrs      []xml.Attr        `xml:",any,attr"`
	Content    []byte            `xml:",innerxml"`
	Nodes      []*XmlNode        `xml:",any"`
	Attributes map[string]string `xml:"-"`
}

func CreateNodeFromFile

func CreateNodeFromFile(path string) (*XmlNode, error)

func CreateNodeFromXML

func CreateNodeFromXML(xmlStr string) (*XmlNode, error)

func New

func New(name string) *XmlNode

Create an XmlNode with name

func Node

func Node(name string, attributes map[string]string) *XmlNode

Create an XmlNode with name and attributes

func Update

func Update(id string, attributes map[string]string) *XmlNode

func (*XmlNode) AddChild

func (n *XmlNode) AddChild(newNode *XmlNode) *XmlNode

func (*XmlNode) MapAttributesRecur

func (n *XmlNode) MapAttributesRecur()

func (*XmlNode) Marshal

func (n *XmlNode) Marshal() []byte

Return XML representing a XmlNode struct

func (*XmlNode) SetAttr

func (n *XmlNode) SetAttr(name string, value string) *XmlNode

func (*XmlNode) SetAttrs

func (n *XmlNode) SetAttrs(a map[string]string) *XmlNode

func (*XmlNode) SetContent

func (n *XmlNode) SetContent(s string) *XmlNode

func (*XmlNode) SetName

func (n *XmlNode) SetName(name string) *XmlNode

Jump to

Keyboard shortcuts

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