yaxml

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROOT           = 0
	DOCUMENT_START = 1
	TAG            = 2
	TEXT           = 3
	ORIGINAL       = 4
)

Variables

This section is empty.

Functions

func GenerateTag

func GenerateTag(text string) (res []string)

generate tag from text

func IsDocumentStart

func IsDocumentStart(text string) (isStart bool)

is start of document?

func IsTag

func IsTag(text string) (res bool)

is tag?

func TypeTagEnd

func TypeTagEnd(text string) (res int)

close state 0 is not close 1 is self close 2 is normal close

Types

type Element

type Element struct {
	Prefix  string
	Name    string
	Type    int
	Attrs   map[string]string
	Parent  *Element
	Chilren []*Element
}

func GenerateElement

func GenerateElement(tag string, parent *Element, mytype int) (ele *Element)

func (*Element) Append

func (e *Element) Append(ele *Element)

func (*Element) Clear

func (e *Element) Clear()

func (*Element) Extract

func (e *Element) Extract() (err error)

func (*Element) Find

func (e *Element) Find(tagName string) (res *Element)

func (*Element) FindAll

func (e *Element) FindAll(tagName string) (res []*Element)

func (*Element) GetItem

func (e *Element) GetItem(name string) string

func (*Element) GetMyIndexByParentChrildren

func (e *Element) GetMyIndexByParentChrildren() int

func (*Element) Insert

func (e *Element) Insert(position int, ele *Element)

func (*Element) InsertBefore

func (e *Element) InsertBefore(ele *Element)

func (*Element) SetItem

func (e *Element) SetItem(name, value string)

func (*Element) Text

func (e *Element) Text() (text []string)

func (*Element) ToString

func (e *Element) ToString() string

Jump to

Keyboard shortcuts

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