MCPcopy Create free account
hub / github.com/beevik/etree / CompilePath

Function CompilePath

path.go:105–112  ·  view source on GitHub ↗

CompilePath creates an optimized version of an XPath-like string that can be used to query elements in an element tree.

(path string)

Source from the content-addressed store, hash-verified

103// CompilePath creates an optimized version of an XPath-like string that
104// can be used to query elements in an element tree.
105func CompilePath(path string) (Path, error) {
106 var comp compiler
107 segments := comp.parsePath(path)
108 if comp.err != ErrPath("") {
109 return Path{nil}, comp.err
110 }
111 return Path{segments}, nil
112}
113
114// MustCompilePath creates an optimized version of an XPath-like string that
115// can be used to query elements in an element tree. Panics if an error

Callers 2

MustCompilePathFunction · 0.85
TestPathFunction · 0.85

Calls 2

parsePathMethod · 0.95
ErrPathTypeAlias · 0.85

Tested by 1

TestPathFunction · 0.68