beta.xquery.Expression

The beta.xquery.Expression class represents a valid, compiled xquery expression. It can be instantiated with the beta.xquery.Expression.compile() classmethod. The same beta.xquery.Expression can be used for multiple executions with different beta.xquery.RuntimeOptions.

There is also a utility function beta.xquery.compile() that can be used to create an beta.xquery.Expression.

Base class: beta.xslt.xpath.Executable -> beta.xslt.xpath.Module

class beta.xquery.Expression

Class methods

classmethod beta.xquery.Expression.compile(type cls, expression, CompileOptions options)

Compiles a new beta.xquery.Expression object from the provided beta.xquery.ExpressionProvider and beta.xquery.CompileOptions. This involves syntax checking, building of AST, initializing of static context components and static-analysis. In case of a syntax or a static error, the beta.xquery.Expression is None and the xml.ErrorLog contains the error(s).

Returns: (beta.xquery.Expression, xml.ErrorLog)

Attributes

beta.xslt.xpath.Module.location
beta.xslt.xpath.Executable.referenced_modules
beta.xslt.xpath.Module.schema
beta.xslt.xpath.Module.strip_input_type_annotations
beta.xslt.xpath.Module.whitespace_handler

Methods

beta.xquery.Expression.execute(RuntimeOptions options)

Execute the compiled xquery expression with the provided beta.xquery.RuntimeOptions. The main result beta.xpath.Sequence can be accessed via the beta.xpath.ResultList.main_value property. Note that the actual value in the beta.xpath.Sequence will vary depending on the beta.xpath.DeliveryFormat specified in the beta.xquery.RuntimeOptions. In case of a runtime error the returned beta.xpath.ResultList is None and the xml.ErrorLog contains the error.

Returns: (xquery.ResultList, xml.ErrorLog)

beta.xslt.xpath.Module.load_xml_document(unicode uri, f)

Special methods

__eq__, __ge__, __gt__, __le__, __lt__, __ne__