Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCursorString ¶ added in v0.9.16
func Unmarshal ¶ added in v0.9.10
func Unmarshal(result Result, value any, settings ...ContextApply) error
Unmarshal maps a XPath result to a struct or slice. When unmarshaling a slice, the result must be a NodeSet. When unmarshaling a struct, the result must be a NodeSet with one result. To unmarshal a value to a struct field, give it a "xsel" tag name, and a XPath expression for its value (e.g. `xsel:"//my-struct[@my-id = 'my-value']"`).
For struct fields, Unmarshal can set fields that are ints and uints, bools, strings, slices, and nested structs.
For slice elements, Unmarshal can set ints and uints, bools, strings, and structs. It cannot Unmarshal multidimensional slices.
Arrays, maps, and channels are not supported.
Types ¶
type ContextApply ¶
type ContextApply func(c *ContextSettings)
type ContextSettings ¶
type ContextSettings struct { NamespaceDecls map[string]string FunctionLibrary map[XmlName]Function Variables map[XmlName]Result }
ContextSettings allows you to add namespace mappings, create new functions, and add variable bindings to your XPath query.