htmltransformer

package
v0.0.0-...-6f0ee80 Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HtmlTransformer

type HtmlTransformer interface {
	//document functions
	CreateElementNode(string) Node
	CreateCDataNode(string) Node
	String() string
	Root() (Node, Node)
	Free()
	SetMetaEncoding(string) error

	// parsing functions
	ParseHTML([]byte, []byte, []byte, []byte) error
	ParseFragment([]byte, []byte, []byte, []byte) (Node, error)
	ParseXML([]byte, []byte, []byte, []byte) error
	CreateEmptyDocument([]byte, []byte)

	// xpath functions
	CheckXPath(string) error
	CompileXPath(string) Selector

	// css functions
	ConvertCSS(string) string
}

type Node

type Node interface {
	// attributes
	GetAttribute(string) Node
	SetAttribute(string, string) Node
	RemoveAttribute(string) Node

	// insertion
	InsertBefore(interface{}) error
	InsertAfter(interface{}) error
	InsertTop(interface{}) error
	InsertBottom(interface{}) error

	// axis
	FirstChild() Node
	LastChild() Node
	PreviousSibling() Node
	NextSibling() Node
	Parent() Node

	//selection
	SelectXPath(interface{}) ([]Node, error)
	SelectXPathByDeadline(interface{}, *time.Time) ([]Node, error)
	SelectCSS(string) ([]Node, error)
	SelectCSSByDeadline(string, *time.Time) ([]Node, error)

	//content
	String() string
	GetContent() string
	SetContent(interface{}) error
	GetInnerHtml() string
	SetInnerHtml(interface{}) error
	GetName() string
	SetName(string)

	// introspetion
	UnderlyingNode() interface{}
	IsValid() bool
	IsDocument() bool
	IsElement() bool
	IsText() bool
	Is(Node) bool
	Path() string

	// maintenance
	Remove()
	Duplicate() Node
}

type Selector

type Selector interface {
	String() string
	Free()
	UnderlyingExpression() interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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