http://www.zorba-xquery.com/modules/introspection/sctx

Description

Before using any of the functions below please remember to import the module namespace:

import module namespace sctx = "http://www.zorba-xquery.com/modules/introspection/sctx";

Intospection Module for the Static Context components.

See also

http://www.w3.org/TR/xquery/#id-xq-static-context-components

Author

Nicolae Brinza

XQuery version and encoding

xquery version "1.0" encoding "utf-8";

Namespaces

sctxhttp://www.zorba-xquery.com/modules/introspection/sctx
verhttp://www.zorba-xquery.com/options/versioning

Function Summary

 base-uri() as xs:string? external

The function returns the base URI.

 boundary-space-policy() as xs:string external

The function returns the static context component which controls the processing of boundary whitespace by direct element constructors.

 construction-mode() as xs:string external

The function returns the static context construction mode of element and document nodes.

 copy-namespaces-mode() as xs:string+ external

The function returns the static context components which control the the namespace bindings that are assigned when an existing element node is copied by an element constructor

 default-collation() as xs:string external

The function returns one of statically known collations that is used by functions and operators for comparing and ordering values of type xs:string or xs:anyURI when no explicit collation is specified.

 default-collection-type() as xs:string external

The function returns the statically known default collection type.

 default-function-namespace() as xs:string external

The function returns the URI of the default function namespace.

 default-order() as xs:string external

The function returns the static context component which controls the processing of empty sequences and NaN values as ordering keys in an order by clause in a FLWOR expression.

 function-annotations($name as xs:QName, $arity as xs:integer) as xs:QName* external

Retrieves the list of annotations declared for the given function.

 function-arguments-count($function as xs:QName) as xs:int* external

The function returns the number of arguments the given XQuery $function takes.

 function-names() as xs:QName* external

The function returns a sequence containing the QNames of all defined functions, which are available to be called from within an expression.

 in-scope-attribute-declarations() as xs:QName* external

The function return a sequence of QNames identifying declared attributes in the imported schemas.

 in-scope-attribute-groups() as xs:QName* external

The function returns a sequence of QNames identifying declared in-scope schema attribute groups.

 in-scope-element-declarations() as xs:QName* external

The function return a sequence of QNames identifying declared elements in the imported schemas.

 in-scope-element-groups() as xs:QName* external

The function returns a sequence of QNames identifying declared in-scope schema element groups.

 in-scope-schema-types() as xs:QName* external

The function returns a sequence of QNames identifying in-scope schema types, including all the predefined schema types and all definitions found in imported schemas.

 in-scope-variables() as xs:QName* external

The function return a sequence of QNames identifying declared variables from the static context.

 option($name as xs:QName) as xs:string? external

Retrieves the value of an option that is declared in the prolog of the module.

 ordering-mode() as xs:string external

The function returns the static context ordering mode, which affects the ordering of the result sequences returned by certain expressions.

 statically-known-collations() as xs:anyURI* external

The function returns a sequence that contains the statically known collations.

 statically-known-document-type($document as xs:string) as xs:QName external

For the given document, the function returns the static type of its root node.

 statically-known-documents() as xs:anyURI* external

The function returns a sequence that contains the URIs of all statically known documents.

 statically-known-namespace-binding($prefix as xs:string) as xs:string? external

For any statically know namespace prefix, the bound URI can be retrieved with the statically-known-namespace-bindings() function.

 statically-known-namespaces() as xs:string* external

The function returns a list of known statically known namespaces as prefixes (fn, xml, xs, xsi, etc).

 xpath10-compatibility-mode() as xs:boolean external

The function returns true or false depending on whether rules for compatibility with XPath 1.

Functions

base-uri#0

declare function sctx:base-uri() as xs:string? external

The function returns the base URI.

Returns

  • xs:string?

    The base URI.

See also

http://www.w3.org/TR/xquery/#dt-base-uri

boundary-space-policy#0

declare function sctx:boundary-space-policy() as xs:string external

The function returns the static context component which controls the processing of boundary whitespace by direct element constructors.

Returns

  • xs:string

    Either "preserve" or "strip", as strings.

See also

http://www.w3.org/TR/xquery/#dt-boundary-space-policy

construction-mode#0

declare function sctx:construction-mode() as xs:string external

The function returns the static context construction mode of element and document nodes.

Returns

  • xs:string

    Either "preserve" or "strip", as strings.

See also

http://www.w3.org/TR/xquery/#dt-construction-mode

copy-namespaces-mode#0

declare function sctx:copy-namespaces-mode() as xs:string+ external

The function returns the static context components which control the the namespace bindings that are assigned when an existing element node is copied by an element constructor

Returns

  • xs:string+

    A sequence containing exactly two strings, of which the first has a value of either "preserve" or "no-preserve" and the second a value of either "inherit" or "no-inherit".

See also

http://www.w3.org/TR/xquery/#dt-copy-namespaces-mode

default-collation#0

declare function sctx:default-collation() as xs:string external

The function returns one of statically known collations that is used by functions and operators for comparing and ordering values of type xs:string or xs:anyURI when no explicit collation is specified.

Returns

  • xs:string

    The collations that is used by default.

See also

http://www.w3.org/TR/xquery/#dt-def-collation

default-collection-type#0

declare function sctx:default-collection-type() as xs:string external

The function returns the statically known default collection type. This is the type of the sequence of nodes that would result from calling the fn:collection function with no arguments.

Returns

  • xs:string

    The type of the default collection.

See also

http://www.w3.org/TR/xquery/#dt-known-default-collection

default-function-namespace#0

declare function sctx:default-function-namespace() as xs:string external

The function returns the URI of the default function namespace.

Returns

  • xs:string

    The URI of the of the default function namespace.

See also

http://www.w3.org/TR/xquery/#dt-def-fn-ns

default-order#0

declare function sctx:default-order() as xs:string external

The function returns the static context component which controls the processing of empty sequences and NaN values as ordering keys in an order by clause in a FLWOR expression.

Returns

  • xs:string

    Either "greatest" or "least", as strings.

See also

http://www.w3.org/TR/xquery/#dt-default-empty-order

function-annotations#2

declare function sctx:function-annotations(
    $name as xs:QName,
    $arity as xs:integer
) as xs:QName* external

Retrieves the list of annotations declared for the given function.

Parameters

  • $name as xs:QName
    the name of the function
  • $arity as xs:integer
    the number of arguments the function takes

Returns

  • xs:QName*

    the list of annotations

function-arguments-count#1

declare function sctx:function-arguments-count(
    $function as xs:QName
) as xs:int* external

The function returns the number of arguments the given XQuery $function takes.

Parameters

  • $function as xs:QName
    A QName identifying a function.

Returns

  • xs:int*

    A sequence of zero or more integers, one for each overloaded version of the given function. An empty sequence is returned if the function is not defined.

See also

http://www.w3.org/TR/xquery/#dt-function-signature

function-names#0

declare function sctx:function-names() as xs:QName* external

The function returns a sequence containing the QNames of all defined functions, which are available to be called from within an expression.

Returns

  • xs:QName*

    A sequence for QNames identifying all functions.

See also

http://www.w3.org/TR/xquery/#dt-function-signature

in-scope-attribute-declarations#0

declare function sctx:in-scope-attribute-declarations() as xs:QName* external

The function return a sequence of QNames identifying declared attributes in the imported schemas.

Returns

  • xs:QName*

    A sequence of QNames, one for each attribute.

See also

http://www.w3.org/TR/xquery/#dt-is-attrs

in-scope-attribute-groups#0

declare function sctx:in-scope-attribute-groups() as xs:QName* external

The function returns a sequence of QNames identifying declared in-scope schema attribute groups.

Returns

  • xs:QName*

    A sequence of QNames, one for each attribute group.

in-scope-element-declarations#0

declare function sctx:in-scope-element-declarations() as xs:QName* external

The function return a sequence of QNames identifying declared elements in the imported schemas.

Returns

  • xs:QName*

    A sequence of QNames, one for each declared element.

See also

http://www.w3.org/TR/xquery/#dt-is-elems

in-scope-element-groups#0

declare function sctx:in-scope-element-groups() as xs:QName* external

The function returns a sequence of QNames identifying declared in-scope schema element groups.

Returns

  • xs:QName*

    A sequence of QNames, one for each element group.

in-scope-schema-types#0

declare function sctx:in-scope-schema-types() as xs:QName* external

The function returns a sequence of QNames identifying in-scope schema types, including all the predefined schema types and all definitions found in imported schemas.

Returns

  • xs:QName*

    A sequence of QNames, one for each defined type.

See also

http://www.w3.org/TR/xquery/#dt-is-types

in-scope-variables#0

declare function sctx:in-scope-variables() as xs:QName* external

The function return a sequence of QNames identifying declared variables from the static context.

Returns

  • xs:QName*

    A sequence of QNames, one for each variable.

See also

http://www.w3.org/TR/xquery/#dt-in-scope-variables

option#1

declare function sctx:option(
    $name as xs:QName
) as xs:string? external

Retrieves the value of an option that is declared in the prolog of the module.

Parameters

  • $name as xs:QName
    the name of the option value to retrieve

Returns

  • xs:string?

    the value of the option if contained in the static context or the empty sequence otherwise.

ordering-mode#0

declare function sctx:ordering-mode() as xs:string external

The function returns the static context ordering mode, which affects the ordering of the result sequences returned by certain expressions.

Returns

  • xs:string

    Either "ordered" or "unordered", as strings.

See also

http://www.w3.org/TR/xquery/#dt-ordering-mode

statically-known-collations#0

declare function sctx:statically-known-collations() as xs:anyURI* external

The function returns a sequence that contains the statically known collations.

Returns

  • xs:anyURI*

    The sequence of collations.

See also

http://www.w3.org/TR/xquery/#dt-static-collations

statically-known-document-type#1

declare function sctx:statically-known-document-type(
    $document as xs:string
) as xs:QName external

For the given document, the function returns the static type of its root node.

Parameters

  • $document as xs:string
    An URI of a document.

Returns

  • xs:QName

    The static type of the given document.

See also

http://www.w3.org/TR/xquery/#dt-known-docs

statically-known-documents#0

declare function sctx:statically-known-documents() as xs:anyURI* external

The function returns a sequence that contains the URIs of all statically known documents.

Returns

  • xs:anyURI*

    The sequence of document URIs.

See also

http://www.w3.org/TR/xquery/#dt-known-docs

statically-known-namespace-binding#1

declare function sctx:statically-known-namespace-binding(
    $prefix as xs:string
) as xs:string? external

For any statically know namespace prefix, the bound URI can be retrieved with the statically-known-namespace-bindings() function.

Parameters

  • $prefix as xs:string
    The prefix of the known namespace, for which the bound URI is being requested.

Returns

  • xs:string?

    The URI bound to the prefix is returned, or an empty sequence if the prefix is not known.

See also

http://www.w3.org/TR/xquery/#dt-static-namespaces

statically-known-namespaces#0

declare function sctx:statically-known-namespaces() as xs:string* external

The function returns a list of known statically known namespaces as prefixes (fn, xml, xs, xsi, etc).

Returns

  • xs:string*

    A sequence of xs:strings, one for each known namespace prefix.

See also

http://www.w3.org/TR/xquery/#dt-static-namespaces

xpath10-compatibility-mode#0

declare function sctx:xpath10-compatibility-mode() as xs:boolean external

The function returns true or false depending on whether rules for compatibility with XPath 1.0 are in effect. XQuery set the value of this component to false.

Returns

  • xs:boolean

    The function should return false

See also

http://www.w3.org/TR/xquery/#dt-xpath-compat-mode

blog comments powered by Disqus