XPathProcessor
class XPathProcessor (View source)
Methods
Set the context item from file
Evaluate the XPath expression, returning the effective boolean value of the result.
Compile and evaluate an XPath expression, supplied as a character string. Result is an XdmValue
Compile and evaluate an XPath expression whose result is expected to be a single item, with a given context item. The expression is supplied as a character string, and the result returned as an XdmItem. Return NULL if the expression returns an empty sequence. If the expression returns a sequence of more than one item, any items after the first are ignored.
Declare a namespace binding as part of the static context for XPath expressions compiled using this XPathProcessor
Set the static base URI for XPath expressions compiled using this XQuery Processor. The base URI is part of the static context, and is used to resolve any relative URIS appearing within a query
Set properties for Query.
Clear parameter values set
Clear property values set
Clear any exception thrown
Get the $i'th error code if there are any errors
Get the $i'th error message if there are any errors
Get number of error during execution or evaluate of stylesheet and query, respectively
Details
void
setContextItem(XdmItem $item)
Set the context item from a XdmItem
void
setContextFile(string $fileName)
Set the context item from file
bool
effectiveBooleanValue(string $xpathStr)
Evaluate the XPath expression, returning the effective boolean value of the result.
XdmValue
evaluate(string $xpathStr)
Compile and evaluate an XPath expression, supplied as a character string. Result is an XdmValue
XdmItem|null
evaluateSingle(string $xpathStr)
Compile and evaluate an XPath expression whose result is expected to be a single item, with a given context item. The expression is supplied as a character string, and the result returned as an XdmItem. Return NULL if the expression returns an empty sequence. If the expression returns a sequence of more than one item, any items after the first are ignored.
void
declareNamespace($prefix, $namespace)
Declare a namespace binding as part of the static context for XPath expressions compiled using this XPathProcessor
void
setBaseURI(string $uri)
Set the static base URI for XPath expressions compiled using this XQuery Processor. The base URI is part of the static context, and is used to resolve any relative URIS appearing within a query
void
setParameter(string $name, XdmValue $value)
Set the parameters required for XQuery Processor
void
setProperty(string $name, string $value)
Set properties for Query.
void
clearParameters()
Clear parameter values set
void
clearProperties()
Clear property values set
void
exceptionClear()
Clear any exception thrown
string
getErrorCode(int $i)
Get the $i'th error code if there are any errors
string
getErrorMessage(int $i)
Get the $i'th error message if there are any errors
int
getExceptionCount()
Get number of error during execution or evaluate of stylesheet and query, respectively