Documentation
¶
Index ¶
- func CheckWellFormed(input string, document bool) error
- func Compile(expr string, namespaces map[string]string) (*xpath.Expr, error)
- func Concat(values ...string) string
- func Declaration(version string, standalone string) string
- func EscapeText(str string) string
- func Evaluate(expr *xpath.Expr, nav xpath.NodeNavigator) (result any, err error)
- func NodeToXml(nav *xmlquery.NodeNavigator) string
- func Output(str string) string
- func ParseDocument(str string) (*xmlquery.Node, error)
- func ScalarToString(result any) string
- func SplitDeclaration(str string) (version string, standalone string, rest string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckWellFormed ¶
CheckWellFormed returns an error if `input` is not well-formed XML content, or not a well-formed XML document when `document` is set.
func Compile ¶
Compile compiles the XPath expression `expr` using the prefix-to-URI map `namespaces`.
func Concat ¶
Concat concatenates the xml values `values`, merging their XML declarations the way PostgreSQL's `xmlconcat` does.
func Declaration ¶
Declaration returns the XML declaration that PostgreSQL prints for the given version and standalone values, which is empty when the version is 1.0 (or unknown) and standalone is absent.
func EscapeText ¶
EscapeText escapes the characters of `str` that may not appear literally in XML text.
func Evaluate ¶
Evaluate evaluates `expr` with `nav` as the context node, returning a `*xpath.NodeIterator`, bool, float64, or string.
func NodeToXml ¶
func NodeToXml(nav *xmlquery.NodeNavigator) string
NodeToXml converts a node selected by an XPath expression into the text of an xml value.
func Output ¶
Output returns the text form of an xml value, dropping or trimming a leading XML declaration the way PostgreSQL's `xml_out` does.
func ParseDocument ¶
ParseDocument parses `str` as an XML document.
func ScalarToString ¶
ScalarToString formats a non-node XPath result the way the XPath `string` function does.
Types ¶
This section is empty.