class XPathProcessor (View source)

Methods

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.

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

Details

void setContextItem(XdmItem $item)

Set the context item from a XdmItem

Parameters

XdmItem $item

Return Value

void

void setContextFile(string $fileName)

Set the context item from file

Parameters

string $fileName

Return Value

void

bool effectiveBooleanValue(string $xpathStr)

Evaluate the XPath expression, returning the effective boolean value of the result.

Parameters

string $xpathStr

Return Value

bool

XdmValue evaluate(string $xpathStr)

Compile and evaluate an XPath expression, supplied as a character string. Result is an XdmValue

Parameters

string $xpathStr

Return Value

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.

Parameters

string $xpathStr

Return Value

XdmItem|null

void declareNamespace($prefix, $namespace)

Declare a namespace binding as part of the static context for XPath expressions compiled using this XPathProcessor

Parameters

$prefix
$namespace

Return Value

void

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

Parameters

string $uri

Return Value

void

void setParameter(string $name, XdmValue $value)

Set the parameters required for XQuery Processor

Parameters

string $name
XdmValue $value

Return Value

void

void setProperty(string $name, string $value)

Set properties for Query.

Parameters

string $name
string $value

Return Value

void

void clearParameters()

Clear parameter values set

Return Value

void

void clearProperties()

Clear property values set

Return Value

void

void exceptionClear()

Clear any exception thrown

Return Value

void

string getErrorCode(int $i)

Get the $i'th error code if there are any errors

Parameters

int $i

Return Value

string

string getErrorMessage(int $i)

Get the $i'th error message if there are any errors

Parameters

int $i

Return Value

string

int getExceptionCount()

Get number of error during execution or evaluate of stylesheet and query, respectively

Return Value

int