Files
goquery/selection.go
2012-08-30 13:43:44 -04:00

28 lines
456 B
Go

package goquery
import (
"exp/html"
)
type Selection struct {
Nodes []*html.Node
document *Document
prevSel *Selection
}
func (this *Selection) Size() int {
return this.Length()
}
func (this *Selection) Length() int {
return len(this.Nodes)
}
func newEmptySelection(doc *Document) *Selection {
return &Selection{nil, doc}
}
func newSingleSelection(node *html.Node, doc *Document) *Selection {
return &Selection{[]*html.Node{node}, doc}
}