forked from lestrrat-go/libxml2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.go
More file actions
26 lines (21 loc) · 678 Bytes
/
parser.go
File metadata and controls
26 lines (21 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package libxml2
import (
"io"
"github.com/killi1812/libxml2/parser"
"github.com/killi1812/libxml2/types"
)
// Parse parses the given buffer and returns a Document.
func Parse(buf []byte, o ...parser.Option) (types.Document, error) {
p := parser.New(o...)
return p.Parse(buf)
}
// ParseString parses the given string and returns a Document.
func ParseString(s string, o ...parser.Option) (types.Document, error) {
p := parser.New(o...)
return p.ParseString(s)
}
// ParseReader parses XML from the given io.Reader and returns a Document.
func ParseReader(rdr io.Reader, o ...parser.Option) (types.Document, error) {
p := parser.New(o...)
return p.ParseReader(rdr)
}