commonxml

package
v0.0.0-...-75625ea Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2017 License: BSD-3-Clause Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(u string, v interface{}) error

func Parse

func Parse(d []byte, v interface{}) error

Types

type DOMNode

type DOMNode struct {
	Type       DOMType
	XMLName    xml.Name
	Attributes []xml.Attr   `xml:",any,attr"`
	Children   []*DOMNode   `xml:",any"`
	CharData   xml.CharData `xml:",chardata"`
}

func (*DOMNode) GetAttribute

func (d *DOMNode) GetAttribute(name xml.Name) *xml.Attr

func (*DOMNode) GetAttributes

func (d *DOMNode) GetAttributes(name xml.Name) []xml.Attr

func (*DOMNode) GetChildByTagName

func (d *DOMNode) GetChildByTagName(name xml.Name) *DOMNode

func (*DOMNode) GetChildrenByTagName

func (d *DOMNode) GetChildrenByTagName(name xml.Name) []*DOMNode

func (*DOMNode) GetElementByTagName

func (d *DOMNode) GetElementByTagName(name xml.Name) *DOMNode

func (*DOMNode) GetElementsByTagName

func (d *DOMNode) GetElementsByTagName(name xml.Name) []*DOMNode

func (*DOMNode) MarshalXML

func (n *DOMNode) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*DOMNode) Text

func (d *DOMNode) Text() string

func (*DOMNode) UnmarshalInto

func (d *DOMNode) UnmarshalInto(v interface{}) error

func (*DOMNode) UnmarshalXML

func (n *DOMNode) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type DOMType

type DOMType int
const (
	DOMTypeNone DOMType = iota
	DOMTypeElement
	DOMTypeText
)

type HasAttributes

type HasAttributes struct {
	Attributes []xml.Attr `xml:",any,attr" json:"attributes,omitempty"`
}

func (*HasAttributes) GetAttribute

func (a *HasAttributes) GetAttribute(name xml.Name) *xml.Attr

func (*HasAttributes) GetAttributes

func (a *HasAttributes) GetAttributes(name xml.Name) []xml.Attr
type HasLinks struct {
	Link []Link `xml:"link" json:"link,omitempty"`
}
func (v *HasLinks) GetLink(rel string) *Link
func (v *HasLinks) GetLinks(rel string) []Link

type HasProperties

type HasProperties struct {
	Property []Property `xml:"link" json:"link,omitempty"`
}

func (*HasProperties) GetProperties

func (v *HasProperties) GetProperties(typ string) []Property

func (*HasProperties) GetProperty

func (v *HasProperties) GetProperty(typ string) *Property
type Link struct {
	HasAttributes

	Rel      string `xml:"rel,attr,omitempty" json:"rel,omitempty"`
	Type     string `xml:"type,attr,omitempty" json:"type,omitempty"`
	Href     string `xml:"href,attr" json:"href,omitempty"`
	HrefLang string `xml:"hreflang,attr,omitempty" json:"hrefLang,omitempty"`
	Template string `xml:"template,attr,omitempty" json:"template,omitempty"`
	Title    string `xml:"title,attr,omitempty" json:"title,omitempty"`
	Length   uint   `xml:"length,attr,omitempty" json:"length,omitempty"`
}

type Property

type Property struct {
	Type  string `xml:"type,attr,omitempty" json:"type,omitempty"`
	Value string `xml:",chardata" json:"value,omitempty"`
}

Jump to

Keyboard shortcuts

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