XPath, XQuery, XQuery and XPath Functions and Operators, XDM - 3.1 - Sorted Definitions Draft Version 0.1

19 January 2015

By Patrick Durusau, patrick@durusau.net

The following definitions were extracted from XML Path Language (XPath) 3.1 http://www.w3.org/TR/2014/CR-xpath-31-20141218/, XQuery 3.1: An XML Query Language, http://www.w3.org/TR/2014/CR-xquery-31-20141218/, XPath and XQuery Functions and Operators 3.1, http://www.w3.org/TR/2014/CR-xpath-functions-31-20141218/, and, XQuery and XPath Data Model 3.1, http://www.w3.org/TR/2014/CR-xpath-datamodel-31-20141218/.

Where more than one definition for a term appears, the definitions differ. My comments on differing definitions are incomplete.

Warning on incompleteness of this set of definitions: This set of definitions may be incomplete because some of the drafts stated definitions without so marking them. Other "definitions" may be lurking in these drafts.

This set contains two hundred and thirty-one (231) entries. Where more than one specification reports the same definition, I have so indicated by noting which specifications have that definition by appending to the end of the definition: XPath 3.1, XQuery 3.1, XPath and XQuery Functions and Operators 3.1, and XDM. The order of the origin markers isn't significant.

My comments appear inside the origin markers to distinguish them from the extracted text.

Comments on Definitions in General

Embedding of the definitions in prose makes use and comparison of definitions far more difficult than necessary. Moreover, a numbered listing of the definitions where originally defined, would have facilitated referencing those definitions by other specifications (such as the ones under review here). Not to mention enabling the editors to see when their definitions diverge from one another.

To say a specification should be read with other specifications is insufficient to invoke specific definitions used in another specification. That places an additional and unnecssary burden on readers of the specification and results, whether intended or not, in an "insider" specification.

For example, XDM 3.1 reads at 2.7.3 XML and XSD Versions:

[Definition: A string is a value in the value space of the xs:string data type; equivalently, it is a sequence of characters.]

[Definition: A character is an instance of the Char production in [XML]. It is recommended that the implementation use the latest definition, currently XML 1.1 Second Edition.]

And yet, XPath 3.1 reads at 2 Basics:
The basic building block of XPath 3.1 is the expression, which is a string of [Unicode] characters; the version of Unicode to be used is implementation-defined.
"[Unicode] characters" does NOT EQUAL "Char production in [XML]. So, as a reader of the specification, which is it? Any Unicode character can appear in an expression or is XPath 3.1 limited to the Char production?

More comments will be appended here and on the individual definitions as I revise this document.


[Definition: When a property has no value, we say that it is absent.] XDM

Definition: An argument to a function call is either an argument expression or an ArgumentPlaceholder ("?").] If the EQName in a static function call is a lexical QName that has no namespace prefix, it is considered to be in the default function namespace.XPath 3.1 XQuery 3.1

[Definition: Argument expressions are evaluated with respect to DC, producing argument values.] The order of argument evaluation is implementation-dependent and a function need not evaluate an argument if the function can evaluate its body without evaluating that argument.XPath 3.1 XQuery 3.1

[Definition: The number of Arguments in an ArgumentList is its arity. ]XPath 3.1 XQuery 3.1

[Definition: An array is a function that associates a set of positions, represented as positive integer keys, with values.] The first position in an array is associated with the integer 1.XPath 3.1 XQuery 3.1

[Definition: An array item is a value that represents an array.] An array is an ordered list of values; these values are called the members of the array. Unlike sequences, a member of an array can be any value (including a sequence or an array). The number of members in an array is called its size, and they are referenced by their position, in the range 1 to the size of the array. XDM

[Definition: An arrow operator is a postfix operator that applies a function to an item, using the item as the first argument to the function.] If $s is a sequence and f() is a function, then $s=>f() is equivalent to f($s), and $s=>f($j) is equivalent to f($s, $j).XPath 3.1 XQuery 3.1

Definition: The value associated with a given key is called the associated value of the key.]XPath 3.1 XQuery 3.1

[Definition: An atomic type is a primitive simple type or a type derived by restriction from another atomic type.] (Types derived by list or union are not atomic.) XDM

Definition: An atomic value is a value in the value space of an atomic type, as defined in [XML Schema 1.0] or [XML Schema 1.1].XPath 3.1 XQuery 3.1

[Definition: An atomic value is a value in the value space of an atomic type and is labeled with the name of that atomic type.] XDM Note the difference from XPath 3.1 and XQuery 3.1.

[Definition: Atomization of a sequence is defined as the result of invoking the fn:data function on the sequence, as defined in [XQuery and XPath Functions and Operators 3.1].]XPath 3.1 XQuery 3.1

[Definition: Available documents. This is a mapping of strings to document nodes. Each string represents the absolute URI of a resource. The document node is the root of a tree that represents that resource using the data model. The document node is returned by the fn:doc function when applied to that URI.] The set of available documents is not limited to the set of statically known documents, and it may be empty.XPath 3.1 XQuery 3.1

[Definition: Available node collections. This is a mapping of strings to sequences of nodes. Each string represents the absolute URI of a resource. The sequence of nodes represents the result of the fn:collection function when that URI is supplied as the argument. ] The set of available node collections is not limited to the set of statically known collections, and it may be empty.XPath 3.1 XQuery 3.1

[Definition: Available resource collections. This is a mapping of strings to sequences of URIs. The string represents the absolute URI of a resource which can be interpreted as an aggregation of a number of individual resources each of which has its own URI. The sequence of URIs represents the result of the fn:uri-collection function when that URI is supplied as the argument. ] There is no implication that the URIs in this sequence can be successfully dereferenced, or that the resources they refer to have any particular media type.XPath 3.1 XQuery 3.1

[Definition: Available text resources. This is a mapping of strings to text resources. Each string represents the absolute URI of a resource. The resource is returned by the fn:unparsed-text function when applied to that URI.] The set of available text resources is not limited to the set of statically known documents, and it may be empty.XPath 3.1 XQuery 3.1

[Definition: An axis step returns a sequence of nodes that are reachable from the context node via a specified axis. Such a step has two parts: an axis, which defines the "direction of movement" for the step, and a node test, which selects nodes based on their kind, name, and/or type annotation.] If the context item is a node, an axis step returns a sequence of zero or more nodes; otherwise, a type error is raised [err:XPTY0020]. The resulting node sequence is returned in document order. An axis step may be either a forward step or a reverse step, followed by zero or more predicates.XPath 3.1

[Definition: An axis step returns a sequence of nodes that are reachable from the context node via a specified axis. Such a step has two parts: an axis, which defines the "direction of movement" for the step, and a node test, which selects nodes based on their kind, name, and/or type annotation.] If the context item is a node, an axis step returns a sequence of zero or more nodes; otherwise, a type error is raised [err:XPTY0020]. If ordering mode is ordered, the resulting node sequence is returned in document order; otherwise it is returned in implementation-dependent order. An axis step may be either a forward step or a reverse step, followed by zero or more predicates.XQuery 3.1

[Definition: A base URI declaration specifies the Static Base URI property. The Static Base URI property is used when resolving relative URI references.] For example, the Static Base URI property is used when resolving relative references for module import and for the fn:doc function.XPath 3.1 has Static Base URI but no Static base URI declaration XQuery 3.1

[Definition: In a for clause or window clause, when an expression is preceded by the keyword in, the value of that expression is called a binding sequence.] The for and window clauses iterate over their binding sequences, producing multiple bindings for one or more variables. Details on how binding sequences are used in for and window clauses are described in the following sections.XQuery 3.1

[Definition: A boundary-space declaration sets the boundary-space policy in the static context, overriding any implementation-defined default. Boundary-space policy controls whether boundary whitespace is preserved by element constructors during processing of the query.] If boundary-space policy is preserve, boundary whitespace is preserved. If boundary-space policy is strip, boundary whitespace is stripped (deleted). A further discussion of whitespace in constructed elements can be found in 3.9.1.4 Boundary Whitespace.XQuery 3.1

[Definition: Boundary-space policy. This component controls the processing of boundary whitespace by direct element constructors, as described in 3.9.1.4 Boundary Whitespace.] Its value may be preserve or strip.XQuery 3.1

[Definition: Boundary whitespace is a sequence of consecutive whitespace characters within the content of a direct element constructor, that is delimited at each end either by the start or end of the content, or by a DirectConstructor, or by an EnclosedExpr. For this purpose, characters generated by character references such as   or by CDataSections are not considered to be whitespace characters.]XQuery 3.1

[Definition: The built-in functions supported by XQuery 3.1 are defined in [XQuery and XPath Functions and Operators 3.1].] Additional functions may be declared in a Prolog, imported from a library module, or provided by the external environment as part of the static context.XPath 3.1 XQuery 3.1

[Definition: The built-in functions supported by XPath 3.1 are defined in [XQuery and XPath Functions and Operators 3.1].] Additional functions may be provided in the static context. XPath per se does not provide a way to declare named functions, but a host language may provide such a mechanism.XPath 3.1

[Definition] A character is an instance of the CharXML production of [Extensible Markup Language (XML) 1.0 (Fifth Edition)].XPath and XQuery Functions and Operators 3.1

[Definition: A character is an instance of the Char production in [XML]. It is recommended that the implementation use the latest definition, currently XML 1.1 Second Edition.] XDM

[Definition: A character reference is an XML-style reference to a [Unicode] character, identified by its decimal or hexadecimal codepoint.] For example, the Euro symbol (€) can be represented by the character reference €. Character references are normatively defined in Section 4.1 of the XML specification (it is implementation-defined whether the rules in [XML 1.0] or [XML 1.1] apply.) A static error [err:XQST0090] is raised if a character reference does not identify a valid character in the version of XML that is in use.XQuery 3.1 - A definition that is not marked as one in the text.

[Definition] A codepoint is a non-negative integer assigned to a ·character· by the Unicode consortium, or reserved for future assignment to a character.XPath and XQuery Functions and Operators 3.1 - Curious why say "non-negative" instead of "an integer in the Unicode codespace." Characters, by the way, are encoded characters when assigned to a code point. Unicode, 7th edition, 2.4 Code Points and Characters.

Definition: A collation is a specification of the manner in which strings and URIs are compared and, by extension, ordered. For a more complete definition of collation, see [XQuery and XPath Functions and Operators 3.1].]XPath 3.1 XQuery 3.1

[Definition: One way to construct a sequence is by using the comma operator, which evaluates each of its operands and concatenates the resulting sequences, in order, into a single result sequence.] Empty parentheses can be used to denote an empty sequence.XPath 3.1 XQuery 3.1

[Definition: A computed element constructor creates an element node, allowing both the name and the content of the node to be computed.]XQuery 3.1

[Definition: A construction declaration sets the construction mode in the static context, overriding any implementation-defined default.] The construction mode governs the behavior of element and document node constructors. If construction mode is preserve, the type of a constructed element node is xs:anyType, and all attribute and element nodes copied during node construction retain their original types. If construction mode is strip, the type of a constructed element node is xs:untyped; all element nodes copied during node construction receive the type xs:untyped, and all attribute nodes copied during node construction receive the type xs:untypedAtomic.XPath 3.1 XQuery 3.1

[Definition: The constructor function for a given type is used to convert instances of other atomic types into the given type. The semantics of the constructor function call T($arg) are defined to be equivalent to the expression (($arg) cast as T?).]XPath 3.1 XQuery 3.1

[Definition: Construction mode. The construction mode governs the behavior of element and document node constructors. If construction mode is preserve, the type of a constructed element node is xs:anyType, and all attribute and element nodes copied during node construction retain their original types. If construction mode is strip, the type of a constructed element node is xs:untyped; all element nodes copied during node construction receive the type xs:untyped, and all attribute nodes copied during node construction receive the type xs:untypedAtomic.]XQuery 3.1

[Definition: The final part of a computed constructor is an expression enclosed in braces, called the content expression of the constructor, that generates the content of the node.]XQuery 3.1

[Definition: The context item is the item currently being processed.XPath 3.1 XQuery 3.1

[Definition: Context item static type. This component defines the static type of the context item within the scope of a given expression.]XPath 3.1 XQuery 3.1

[Definition] A function may have the property of being context-dependent: the result of such a function depends on the values of properties in the static and dynamic evaluation context as well as on the actual supplied arguments (if any).XPath and XQuery Functions and Operators 3.1

[Definition] A function that is not ·context-dependent· is called context-independent.XPath and XQuery Functions and Operators 3.1

Definition: When the context item is a node, it can also be referred to as the context node.] The context item is returned by an expression consisting of a single dot (.). When an expression E1/E2 or E1[E2] is evaluated, each item in the sequence obtained by evaluating E1 becomes the context item in the inner focus for an evaluation of E2.XPath 3.1 XQuery 3.1

[Definition: The context position is the position of the context item within the sequence of items currently being processed.] It changes whenever the context item changes. When the focus is defined, the value of the context position is an integer greater than zero. The context position is returned by the expression fn:position(). When an expression E1/E2 or E1[E2] is evaluated, the context position in the inner focus for an evaluation of E2 is the position of the context item in the sequence obtained by evaluating E1. The position of the first item in a sequence is always 1 (one). The context position is always less than or equal to the context size.XPath 3.1 XQuery 3.1

[Definition: The context size is the number of items in the sequence of items currently being processed.] Its value is always an integer greater than zero. The context size is returned by the expression fn:last(). When an expression E1/E2 or E1[E2] is evaluated, the context size in the inner focus for an evaluation of E2 is the number of items in the sequence obtained by evaluating E1.XPath 3.1 XQuery 3.1

[Definition: A copy-namespaces declaration sets the value of copy-namespaces mode in the static context, overriding any implementation-defined default. Copy-namespaces mode controls the namespace bindings that are assigned when an existing element node is copied by an element constructor or document constructor.] Handling of namespace bindings by element constructors is described in 3.9.1 Direct Element Constructors.XQuery 3.1

[Definition: Copy-namespaces mode. This component controls the namespace bindings that are assigned when an existing element node is copied by an element constructor, as described in 3.9.1 Direct Element Constructors. Its value consists of two parts: preserve or no-preserve, and inherit or no-inherit.]XQuery 3.1

[Definition: Current dateTime. This information represents an implementation-dependent point in time during the processing of an expression, and includes an explicit timezone. It can be retrieved by the fn:current-dateTime function. If invoked multiple times during the execution of an expression, this function always returns the same result.]XPath 3.1 "an expression vs. a query"

[Definition: Current dateTime. This information represents an implementation-dependent point in time during the processing of a query, and includes an explicit timezone. It can be retrieved by the fn:current-dateTime function. If invoked multiple times during the execution of a query, this function always returns the same result.]XPath 3.1 XQuery 3.1

[Definition: XPath 3.1 operates on the abstract, logical structure of an XML document, rather than its surface syntax. This logical structure, known as the data model, is defined in [XQuery and XPath Data Model (XDM) 3.1].]XPath 3.1 "XPath 3.1 vs. XQuery 3.1"

[Definition: XQuery 3.1 operates on the abstract, logical structure of an XML document, rather than its surface syntax. This logical structure, known as the data model, is defined in [XQuery and XPath Data Model (XDM) 3.1].]XQuery 3.1

[Definition] The three functions fn:format-dateTime, fn:format-date, and fn:format-time are referred to collectively as the date formatting functions.XPath and XQuery Functions and Operators 3.1

[Definition] The decimal digit family of a decimal format is the sequence of ten digits with consecutive Unicode ·codepoints· starting with the mandatory-digit-sign.XPath and XQuery Functions and Operators 3.1 Note that "mandatory-digit-sign is defined without using the definition syntax which makes its discovery as a definition accidental. It is found in an unnumbered sub-section of an unnumbered sub-section of 4.6.1 fn:format-integer

[Definition: A decimal format declaration adds a decimal format to the statically known decimal formats, which define the properties used to format numbers using the fn:format-number() function], as described in [XQuery and XPath Functions and Operators 3.1]. The mapping between these properties and the equivalent fn:format-number() properties is discussed in statically known decimal formats, which also specifies the defaults for each value. If a format declares no properties, default values are used for all properties.XQuery 3.1

[Definition: Default calendar. This is the calendar used when formatting dates in human-readable output (for example, by the functions fn:format-date and fn:format-dateTime) if no other calendar is requested. The value is a string.]XPath 3.1 XQuery 3.1

[Definition: Default collation. This identifies one of the collations in statically known collations as the collation to be used by functions and operators for comparing and ordering values of type xs:string and xs:anyURI (and types derived from them) when no explicit collation is specified.]XPath 3.1 XQuery 3.1

[Definition: A default collation declaration sets the value of the default collation in the static context, overriding any implementation-defined default.] The default collation is the collation that is used by functions and operators that require a collation if no other collation is specified. For example, the gt operator on strings is defined by a call to the fn:compare function, which takes an optional collation parameter. Since the gt operator does not specify a collation, the fn:compare function implements gt by using the default collation.XQuery 3.1

[Definition: Default element/type namespace. This is a namespace URI or absentDM31. The namespace URI, if present, is used for any unprefixed QName appearing in a position where an element or type name is expected.] The URI value is whitespace normalized according to the rules for the xs:anyURI type in [XML Schema 1.0] or [XML Schema 1.1].XPath 3.1 XQuery 3.1

[Definition: Default function namespace. This is a namespace URI or absentDM31. The namespace URI, if present, is used for any unprefixed QName appearing in a position where a function name is expected.] The URI value is whitespace normalized according to the rules for the xs:anyURI type in [XML Schema 1.0] or [XML Schema 1.1].XPath 3.1 XQuery 3.1

[Definition: Default language. This is the natural language used when creating human-readable output (for example, by the functions fn:format-date and fn:format-integer) if no other language is requested. The value is a language code as defined by the type xs:language.]XPath 3.1 XQuery 3.1

[Definition: Default node collection. This is the sequence of nodes that would result from calling the fn:collection function with no arguments.] The value of default collection may be initialized by the implementation.XPath 3.1 XQuery 3.1

[Definition: Default order for empty sequences. This component controls the processing of empty sequences and NaN values as ordering keys in an order by clause in a FLWOR expression, as described in 3.11.8 Order By Clause.] Its value may be greatest or least.XQuery 3.1

[Definition: Default place. This is a geographical location used to identify the place where events happened (or will happen) when formatting dates and times using functions such as fn:format-date and fn:format-dateTime, if no other place is specified. It is used when translating timezone offsets to civil timezone names, and when using calendars where the translation from ISO dates/times to a local representation is dependent on geographical location. Possible representations of this information are an ISO country code or an Olson timezone name, but implementations are free to use other representations from which the above information can be derived.]XPath 3.1 XQuery 3.1

[Definition: Default resource collection. This is the sequence of URIs that would result from calling the fn:uri-collection function with no arguments.] The value of default resource collection may be initialized by the implementation.XPath 3.1 XQuery 3.1

[Definition: A variable value (or the context item) depends on another variable value (or the context item) if, during the evaluation of the initializing expression of the former, the latter is accessed through the module context.]XQuery 3.1 XPath 3.1 uses "depend(s) on" seven (7) times but has no equivalent definition.

[Definition] A function that is guaranteed to produce ·identical· results from repeated calls within a single ·execution scope· if the explicit and implicit arguments are identical is referred to as deterministic.XPath and XQuery Functions and Operators 3.1

[Definition: A direct element constructor is a form of element constructor in which the name of the constructed element is a constant.] Direct element constructors are based on standard XML notation. For example, the following expression is a direct element constructor that creates a book element containing an attribute and some nested elements:XQuery 3.1

[Definition: A tree whose root node is a Document Node is referred to as a document.] XDM

[Definition: Informally, document order is the order in which nodes appear in the XML serialization of a document.XPath 3.1 XQuery 3.1

[Definition: A document order is defined among all the nodes accessible during a given query or transformation. Document order is a total ordering, although the relative order of some nodes is implementation-dependent. Informally, document order is the order in which nodes appear in the XML serialization of a document.]XDM The XML serialization of a document isn't the same thing as "all the nodes accessible during a given query or transformation."

[Definition: The dynamic context of an expression is defined as information that is available at the time the expression is evaluated.] If evaluation of an expression relies on some part of the dynamic context that is absentDM31, a dynamic error is raised [err:XPDY0002].XPath 3.1 XQuery 3.1

[Definition: A dynamic error is an error that must be detected during the dynamic evaluation phase and may be detected during the static analysis phase. Numeric overflow is an example of a dynamic error . ]XPath 3.1 XQuery 3.1

[Definition: The dynamic evaluation phase is the phase during which the value of an expression is computed.] It occurs after completion of the static analysis phase.XPath 3.1 XQuery 3.1

[Definition: A dynamic function call consists of a base expression that returns the function and a parenthesized list of zero or more arguments (argument expressions or ArgumentPlaceholders).]XPath 3.1 XQuery 3.1

[Definition: A dynamic type is associated with each value as it is computed. The dynamic type of a value may be more specific than the static type of the expression that computed it (for example, the static type of an expression might be xs:integer*, denoting a sequence of zero or more integers, but at evaluation time its value may have the dynamic type xs:integer, denoting exactly one integer.)]XPath 3.1 XQuery 3.1

[Definition: The effective boolean value of a value is defined as the result of applying the fn:boolean function to the value, as defined in [XQuery and XPath Functions and Operators 3.1].]XPath 3.1 XQuery 3.1

[Definition: An empty order declaration sets the default order for empty sequences in the static context, overriding any implementation-defined default. This declaration controls the processing of empty sequences and NaN values as ordering keys in an order by clause in a FLWOR expression.] An individual order by clause may override the default order for empty sequences by specifying empty greatest or empty least.XQuery 3.1

[Definition: A sequence containing zero items is called an empty sequence.]XPath 3.1 XQuery 3.1

[Definition: If present, a version declaration may optionally include an encoding declaration. The value of the string literal following the keyword encoding is an encoding name, and must conform to the definition of EncName specified in [XML 1.0] [err:XQST0087]. The purpose of an encoding declaration is to allow the writer of a query to provide a string that indicates how the query is encoded, such as "UTF-8", "UTF-16", or "US-ASCII".] Since the encoding of a query may change as the query moves from one environment to another, there can be no guarantee that the encoding declaration is correct.XQuery 3.1

Definition: Each key / value pair in a map is called an entry.XPath 3.1 XQuery 3.1

[Definition: Environment variables. This is a mapping from names to values. Both the names and the values are strings. The names are compared using an implementation-defined collation, and are unique under this collation. The set of environment variables is implementation-defined and may be empty.]XPath 3.1 XQuery 3.1

[Definition: Two tuples T1 and T2 have equivalent grouping keys if and only if, for each grouping variable GV, the atomized value of GV in T1 is deep-equal to the atomized value of GV in T2, as defined by applying the function fn:deep-equal using the appropriate collation.] If these values are of different numeric types, and differ from each other by small amounts, then the deep-equal relationship is not transitive, because of rounding effects occurring during type promotion. When comparing three values A, B, and C such that A eq B, B eq C, but A ne C, then the number of items in the result of the function (as well as the choice of which items are returned) is subject only to the constraints that (a) no two items in the result sequence compare equal to each other, and (b) every input item that does not appear in the result sequence compares equal to some item that does appear in the result sequence. See Section 14.2.1 fn:distinct-values FO31 for further discussion of this issue in a different context.XQuery 3.1

[Definition: In addition to its identifying QName, a dynamic error may also carry a descriptive string and one or more additional values called error values.] An implementation may provide a mechanism whereby an application-defined error handler can process error values and produce diagnostic messages. XQuery 3.1 provides standard error handling via Section 3.16 Try/Catch Expressions XQ31 .XPath 3.1 XQuery 3.1

[Definition] Two function calls are said to be within the same execution scope if the host environment defines them as such. In XSLT, any two calls executed during the same transformation are in the same execution scope (except that static expressions, such as those used in use-when attributes, are in a separate executed during the evaluation of a top-level expression are in the same execution scope. In other contexts, the execution scope is specified by the host environment that invokes the function library.XPath and XQuery Functions and Operators 3.1

[Definition: An expanded QName consists of an optional namespace URI and a local name. An expanded QName also retains its original namespace prefix (if any), to facilitate casting the expanded QName into a string.] Two expanded QNames are equal if their namespace URIs are equal and their local names are equal (even if their namespace prefixes are not equal). Namespace URIs and local names are compared on a codepoint basis, without further normalization.XPath 3.1 XQuery 3.1

[Definition] An expanded-QName is a pair of values consisting of a namespace URI and a local name. They belong to the value space of the [XML Schema Part 2: Datatypes Second Edition] datatype xs:QName. When this document refers to xs:QName we always mean the value space, i.e. a namespace URI, local name pair (and not the lexical space referring to constructs of the form prefix:local-name).XPath and XQuery Functions and Operators 3.1

[Definition: An expanded-QName is a set of three values consisting of a possibly empty prefix, a possibly empty namespace URI, and a local name.] See 3.3.3 QNames and NOTATIONS. XDM Is the answer 2 or 3 values?

[Definition: The expression context for a given expression consists of all the information that can affect the result of the expression.]XPath 3.1 XQuery 3.1

[Definition: An extension expression is an expression whose semantics are implementation-defined.] Typically a particular extension will be recognized by some implementations and not by others. The syntax is designed so that extension expressions can be successfully parsed by all implementations, and so that fallback behavior can be defined for implementations that do not recognize a particular extension.XQuery 3.1

[Definition: External functions are functions that are implemented outside the query environment.] For example, an XQuery implementation might provide a set of external functions in addition to the core function library described in [XQuery and XPath Functions and Operators 3.1]. External functions are identified by the keyword external. The purpose of a function declaration for an external function is to declare the datatypes of the function parameters and result, for use in type checking of the query that contains or imports the function declaration.XQuery 3.1 XPath 3.1 uses "external function" 3 times but has no equivalent definition.

[Definition: An expression followed by a predicate (that is, E1[E2]) is referred to as a filter expression: its effect is to return those items from the value of E1 that satisfy the predicate in E2.] Filter expressions are described in 3.2.1 Filter ExpressionsXPath 3.1 XQuery 3.1

[Definition: In a partial function application, a fixed position is an argument/parameter position for which the ArgumentList has an argument expression (as opposed to an ArgumentPlaceholder). ] (Note that a partial function application need not have any fixed positions.)XPath 3.1 XQuery 3.1

[Definition: The fn:put() Feature allows the fn:put() function, defined in [XQuery Update Facility 3.0] , to be used in a query.] This feature is defined as an update because fn:put() has side effects. It is provided as a separate feature because some implementations may want to be able to output files even if they do not conform to the XQuery Update Facility specification.XQuery 3.1

[Definition: The first three components of the dynamic context (context item, context position, and context size) are called the focus of the expression. ] The focus enables the processor to keep track of which items are being processed by the expression. If any component in the focus is defined, all components of the focus are defined.XPath 3.1 XQuery 3.1

[Definition] A function is focus-dependent if its result depends on the focus (that is, the context item, position, or size).XPath and XQuery Functions and Operators 3.1 The only definition of "focus" for XPath and XQuery Functions and Operators 3.1 is found here.

[Definition] A function that is not ·focus-dependent· is called focus-independentXPath and XQuery Functions and Operators 3.1

[Definition: A tree whose root node is not a Document Node is referred to as a fragment.] XDM

[Definition: A function is an item that can be called. ] Functions cannot be compared for identity, equality, or otherwise, and have no serialization. XDM

[Definition: A function's arity is the number of its parameters. ] The number of names in a function's parameter names, and the number of parameter types in its signature, must equal the function's arity. XDM

[Definition: A function assertion is a predicate that restricts the set of functions matched by a FunctionTest. It uses the same syntax as 4.15 Annotations.] XQuery 3.1 does not currently define any function assertions, but future versions may. Other specifications in the XQuery family may also use function assertions in the future.XQuery 3.1

[Definition: Function coercion wraps a functionDM31 in a new function with signature the same as the expected type. This effectively delays the checking of the argument and return types until the function is invoked.]XPath 3.1 "function coercion" appears 14 times in XQuery 3.1 including the non-normative glossary but never as a definition.

[Definition: The function conversion rules are used to convert an argument value to its expected type; that is, to the declared type of the function parameter. ] The expected type is expressed as a sequence type. The function conversion rules are applied to a given value as follows:XPath 3.1

[Definition: The function conversion rules are used to convert an argument value or a return value to its expected type; that is, to the declared type of the function parameter or return. ] The expected type is expressed as a sequence type. The function conversion rules are applied to a given value as follows:XQuery 3.1

[Definition: A function signature represents the type of a function.] The presence of annotations is language dependent; functions defined in languages, such as XPath, that have no mechanism for defining annotations will create functions in the data model with zero annotations. XDM

[Definition: A generalized atomic type is a type which is either (a) an atomic type or (b) a pure union type ].XPath 3.1 XQuery 3.1

[Definition: In the operator mapping tables, the term Gregorian refers to the types xs:gYearMonth, xs:gYear, xs:gMonthDay, xs:gDay, and xs:gMonth.] For binary operators that accept two Gregorian-type operands, both operands must have the same type (for example, if one operand is of type xs:gDay, the other operand must be of type xs:gDay.)XPath 3.1

[Definition: The atomized value of a grouping variable is called a grouping key.] For each pre-grouping tuple, the grouping keys are created by atomizing the values of the grouping variables (in the post-grouping tuples, each grouping variable is set to the value of the corresponding grouping key, as discussed below). If the value of any grouping variable consists of more than one item, a type error is raised [err:XPTY0004]. If a type declaration is present and the resulting atomized value is not an instance of the specified type, a type error is raised [err:XPTY0004].XQuery 3.1

[Definition: The Higher Order Function Feature allows an expression to evaluate to a function, and allows dynamic function calls.]XQuery 3.1

[Definition] Two values are defined to be identical if they contain the same number of items and the items are pairwise identical. Two items are identical if and only if one of the following conditions applies:XPath and XQuery Functions and Operators 3.1

[Definition: Implementation-defined indicates an aspect that may differ between implementations, but must be specified by the implementor for each particular implementation.]XPath 3.1 XQuery 3.1 XDM

[Definition: Implementation-dependent indicates an aspect that may differ between implementations, is not specified by this or any W3C specification, and is not required to be specified by the implementor for any particular implementation.]XPath 3.1 XQuery 3.1XDM

[Definition] For a ·context-dependent· function, the parts of the context on which it depends are referred to as implicit arguments.XPath and XQuery Functions and Operators 3.1

[Definition: Implicit timezone. This is the timezone to be used when a date, time, or dateTime value that does not have a timezone is used in a comparison or arithmetic operation. The implicit timezone is an implementation-defined value of type xs:dayTimeDuration. See [XML Schema 1.0] or [XML Schema 1.1] for the range of valid values of a timezone.]XPath 3.1 XQuery 3.1

[Definition: In-scope attribute declarations. Each attribute declaration is identified either by an expanded QName (for a top-level attribute declaration) or by an implementation-dependent attribute identifier (for a local attribute declaration). ]XPath 3.1

[Definition: In-scope attribute declarations. Each attribute declaration is identified either by an expanded QName (for a top-level attribute declaration) or by an implementation-dependent attribute identifier (for a local attribute declaration). If the Schema Aware Feature is supported, in-scope attribute declarations include all attribute declarations found in imported schemas. ]XQuery 3.1 differs b/c of Schema Aware Feature language.

[Definition: In-scope element declarations. Each element declaration is identified either by an expanded QName (for a top-level element declaration) or by an implementation-dependent element identifier (for a local element declaration). ] An element declaration includes information about the element's substitution group affiliation.XPath 3.1

[Definition: In-scope element declarations. Each element declaration is identified either by an expanded QName (for a top-level element declaration) or by an implementation-dependent element identifier (for a local element declaration). If the Schema Aware Feature is supported, in-scope element declarations include all element declarations found in imported schemas. ] An element declaration includes information about the element's substitution group affiliation.XQuery 3.1 differs b/c of Schema Aware Feature

[Definition: The in-scope namespaces property of an element node is a set of namespace bindings, each of which associates a namespace prefix with a URI.] For a given element, one namespace binding may have an empty prefix; the URI of this namespace binding is the default namespace within the scope of the element.XPath 3.1 XQuery 3.1

[Definition: In-scope schema definitions. This is a generic term for all the element declarations, attribute declarations, and schema type definitions that are in scope during static analysis of an expression.] It includes the following three parts:XPath 3.1 XQuery 3.1

[Definition: In-scope schema types. Each schema type definition is identified either by an expanded QName (for a named type) or by an implementation-dependent type identifier (for an anonymous type). The in-scope schema types include the predefined schema types described in 2.5.1 Predefined Schema Types. ]XPath 3.1

[Definition: In-scope schema types. Each schema type definition is identified either by an expanded QName (for a named type) or by an implementation-dependent type identifier (for an anonymous type). The in-scope schema types include the predefined schema types described in 2.5.1 Predefined Schema Types. If the Schema Aware Feature is supported, in-scope schema types also include all type definitions found in imported schemas. ]XQuery 3.1 differs b/c of Schema Aware Feature

[Definition: In-scope variables. This is a mapping from expanded QName to type. It defines the set of variables that are available for reference within an expression. The expanded QName is the name of the variable, and the type is the static type of the variable.]XPath 3.1 XQuery 3.1

[Definition: An incompletely validated document is an XML document that has a corresponding schema but whose schema-validity assessment has resulted in one or more element or attribute information items being assigned values other than 'valid' for the [validity] property in the PSVI.] XDM

[Definition: The initial context item is a context item that an implementation can set before processing a query begins. The query body and the prolog of every module in a query share the same initial context item.]XPath 3.1 XQuery 3.1

[Definition: An inline function expression creates an anonymous functionDM31 defined directly in the inline function expression itself.] An inline function expression specifies the names and SequenceTypes of the parameters to the function, the SequenceType of the result, and the body of the function.XPath 3.1 XQuery 3.1

[Definition: If a variable declaration includes an expression (VarValue or VarDefaultValue), the expression is called an initializing expression. The static context for an initializing expression includes all functions, variables, and namespaces that are declared or imported anywhere in the Prolog, other than the variable being declared.]XQuery 3.1

[Definition: Every instance of the data model is a sequence.] XDM

Definition: An item is either an atomic value, a node, or a functionDM31.XPath 3.1 XQuery 3.1

[Definition: An item is either a node, a function, or an atomic value.] XDM - Does function without "DM31" have a meaning different from function without "DM31?"

[Definition: An alternative form of a node test called a kind test can select nodes based on their kind, name, and type annotation.] The syntax and semantics of a kind test are described in 2.5.4 SequenceType Syntax and 2.5.5 SequenceType Matching. When a kind test is used in a node test, only those nodes on the designated axis that match the kind test are selected. Shown below are several examples of kind tests that might be used in path expressions:XPath 3.1 XQuery 3.1

[Definition: A lexical QName is a name that conforms to the syntax of [http://www.w3.org/TR/REC-xml-names/#NT-QName].] A lexical QName consists of an optional namespace prefix and a local name. If the namespace prefix is present, it is separated from the local name by a colon. A lexical QName with a prefix can be converted into an expanded QName by resolving its namespace prefix to a namespace URI, using the statically known namespaces. The semantics of a lexical QName without a prefix depend on the expression in which it is found.XPath 3.1 XQuery 3.1

[Definition: A module that does not contain a Query Body is called a library module. A library module consists of a module declaration followed by a Prolog.] A library module cannot be evaluated directly; instead, it provides function and variable declarations that can be imported into other modules.XQuery 3.1

[Definition: A literal is a direct syntactic representation of an atomic value.] XQuery 3.1 supports two kinds of literals: numeric literals and string literals.XPath 3.1 XQuery 3.1

[Definition: A main module consists of a Prolog followed by a Query Body.] A query has exactly one main module. In a main module, the Query Body is evaluated with respect to the static and dynamic contexts of the main module in which it is found, and its value is the result of the query.XQuery 3.1

[Definition: A map is a function that associates a set of keys with values, resulting in a collection of key / value pairs.XPath 3.1 XQuery 3.1

[Definition] A map consists of a set of entries. Each entry comprises a key which is an arbitrary atomic value, and an arbitrary sequence called the associated value.XPath and XQuery Functions and Operators 3.1 In XPath/XQuery, values are always sequences.

[Definition: A map item is a value that represents a map (sometimes called a hash or an associative array).] A map is logically a collection of key/value pairs. Each key in the map is unique (there is no other key to which it is equal) and has associated with it a value that is a single item or sequence of items. There is no uniqueness constraint on values. XDM

[Definition: The values of an array are called its members.] In the type hierarchy, array has a distinct type, which is derived from function. Atomization converts arrays to sequences (see Atomization).XPath 3.1 XQuery 3.1

[Definition: A module is a fragment of XQuery code that conforms to the Module grammar and can independently undergo the static analysis phase described in 2.2.3 Expression Processing. Each module is either a main module or a library module.]XQuery 3.1

[Definition: The module context for a given module consists of all the information that is accessible to top-level expressions in the module.] The context of a top-level expression is defined based on the context of the module in which it is defined: the context of the QueryBody is the context of the main module, and the context for evaluating a function body or for a variable's initializing expression is defined based on the context of the module in which the function or variable is defined.XQuery 3.1

[Definition: A module declaration serves to identify a module as a library module. A module declaration begins with the keyword module and contains a namespace prefix and a URILiteral.] The URILiteral must be of nonzero length [err:XQST0088]. The URILiteral identifies the target namespace of the library module, which is the namespace for all variables and functions exported by the library module. The name of every variable and function declared in a library module must have a namespace URI that is the same as the target namespace of the module; otherwise a static error is raised [err:XQST0048]. The (prefix,URI) pair is added to the set of statically known namespaces.XQuery 3.1

[Definition: The Module Feature allows a query Prolog to contain a Module Import and allows library modules to be created.]XQuery 3.1

[Definition: A module import imports the public variable declarations and public function declarations from one or more library modules into the statically known function signatures and in-scope variables of the importing module.] Each module import names a target namespace and imports an implementation-defined set of modules that share this target namespace. The module import may bind a namespace prefix to the target namespace, adding the (prefix, URI) pair to the statically known namespaces, and it may provide optional hints for locating the modules to be imported.XQuery 3.1

[Definition: When an expression is used to specify the name of a constructed node, that expression is called the name expression of the constructor.]XQuery 3.1

[Definition: A node test that consists only of an EQName or a Wildcard is called a name test.] A name test is true if and only if the kind of the node is the principal node kind for the step axis and the expanded QName of the node is equal (as defined by the eq operator) to the expanded QName specified by the name test. For example, child::para selects the para element children of the context node; if the context node has no para children, it selects an empty set of nodes. attribute::abc:href selects the attribute of the context node with the QName abc:href; if the context node has no such attribute, it selects an empty set of nodes.XPath 3.1 XQuery 3.1

Definition: A named function is a function defined in the static context for the query. To uniquely identify a particular named function, both its name as an expanded QName and its arity are required.]XPath 3.1 XQuery 3.1

[Definition: A named function reference denotes a named function.XPath 3.1 XQuery 3.1

[Definition: Named functions. This is a mapping from (expanded QName, arity) to functionDM31. ] It supplies a function for each signature in statically known function signatures and may supply other functions (see 2.2.5 Consistency Constraints). Named functions can include functions with implementation-dependent implementations; these functions do not have a static context or a dynamic context of their own.XPath 3.1 XQuery 3.1

[Definition: A namespace declaration declares a namespace prefix and associates it with a namespace URI, adding the (prefix, URI) pair to the set of statically known namespaces.] The namespace declaration is in scope throughout the query in which it is declared, unless it is overridden by a namespace declaration attribute in a direct element constructor.XQuery 3.1 XPath 3.1 uses "namespace declaration" 2 times without an equivalent definition

[Definition: A namespace declaration attribute is used inside a direct element constructor. Its purpose is to bind a namespace prefix or to set the default element/type namespace for the constructed element node, including its attributes.] Syntactically, a namespace declaration attribute has the form of an attribute with namespace prefix xmlns, or with name xmlns and no namespace prefix. All the namespace declaration attributes of a given element must have distinct names [err:XQST0071]. Each namespace declaration attribute is processed as follows:XQuery 3.1

[Definition: The namespace-sensitive types are xs:QName, xs:NOTATION, types derived by restriction from xs:QName or xs:NOTATION, list types that have a namespace-sensitive item type, and union types with a namespace-sensitive type in their transitive membership.]XPath 3.1 XQuery 3.1

[Definition: This specification uses the term Namespace URI to refer to a namespace name, whether or not it is a valid URI or IRI]. Following the lead of [Namespaces in XML] and [Namespaces in XML 1.1], processors implementing this data model may raise an error if a namespace name is not a valid URI or IRI (depending on whether they support [Namespaces in XML] or [Namespaces in XML 1.1]), but they are not required to make any checks. Note that the use of a relative reference as a namespace name is deprecated and is defined to be meaningless, but it is not an error. Namespace names, whatever form they take, are treated as character strings and compared for equality using codepoint-by-codepoint comparison, subject only to whitespace normalization if they appear in a context (for example, within an attribute value) where this is appropriate. XDM

Definition: A node is an instance of one of the node kinds defined in [XQuery and XPath Data Model (XDM) 3.1].] Each node has a unique node identity, a typed value, and a string value. In addition, some nodes have a name. The typed value of a node is a sequence of zero or more atomic values. The string value of a node is a value of type xs:string. The name of a node is a value of type xs:QName.XPath 3.1 XQuery 3.1

[Definition: There are seven kinds of Nodes in the data model: document, element, attribute, text, namespace, processing instruction, and comment.] Each kind of node is described in the following sections.XDM

[Definition: A node test is a condition on the name, kind (element, attribute, text, document, comment, or processing instruction), and/or type annotation of a node. A node test determines which nodes contained by an axis are selected by a step.]XPath 3.1 XQuery 3.1

[Definition] A function that is not ·deterministic· is referred to as nondeterministic.XPath and XQuery Functions and Operators 3.1

[Definition: When referring to a type, the term numeric denotes the types xs:integer, xs:decimal, xs:float, and xs:double which are all member types of the built-in union type xs:numeric .] An operator whose operands and result are designated as numeric might be thought of as representing four operators, one for each of the numeric types. For example, the numeric + operator might be thought of as representing the following four operators:XPath 3.1 XQuery 3.1

[Definition: A predicate whose predicate expression returns a numeric type is called a numeric predicate.]XPath 3.1 XQuery 3.1

[Definition: For each operator and valid combination of operand types, the operator mapping tables specify a result type and an operator function that implements the semantics of the operator for the given types.] The definitions of the operator functions are given in [XQuery and XPath Functions and Operators 3.1]. The result of an operator may be the raising of an error by its operator function, as defined in [XQuery and XPath Functions and Operators 3.1]. In some cases, the operator function does not implement the full semantics of a given operator. For the definition of each operator (including its behavior for empty sequences or sequences of length greater than one), see the descriptive material in the main part of this document.XPath 3.1 only difference is XQuery for XPath XQuery 3.1

[Definition: An option declaration declares an option that affects the behavior of a particular implementation. Each option consists of an identifying EQName and a StringLiteral.]XQuery 3.1

[Definition: Ordering mode. Ordering mode, which has the value ordered or unordered, affects the ordering of the result sequence returned by certain expressions, as discussed in 3.12 Ordered and Unordered Expressions.]XQuery 3.1 XPath 3.1 uses "ordering mode" once without an equivalent definition.

[Definition: An ordering mode declaration sets the ordering mode in the static context, overriding any implementation-defined default.] This ordering mode applies to all expressions in a module (including both the Prolog and the Query Body, if any), unless overridden by an ordered or unordered expression.XQuery 3.1

[Definition: An output declaration is an option declaration in the namespace "http://www.w3.org/2010/xslt-xquery-serialization"; it is used to declare serialization parameters.] Except for parameter-document, each option corresponds to a serialization parameter element defined in Section B Schema for Serialization Parameters SER31. The name of each option is the same as the name of the corresponding serialization parameter element, and the values permitted for each option are the same as the values allowed in the serialization parameter element. There is no output declaration for use-character-maps, it can be set only by means of a parameter document. When the application requests serialization of the output, the processor may use these parameters to control the way in which the serialization takes place. Processors may also allow external mechanisms for specifying serialization parameters, which may or may not override serialization parameters specified in the query prolog.XQuery 3.1

[Definition: A static or dynamic function call is a partial function application if one or more arguments is an ArgumentPlaceholder. ]XPath 3.1 XQuery 3.1

[Definition: A path expression can be used to locate nodes within trees. A path expression consists of a series of one or more steps, separated by "/" or "//", and optionally beginning with "/" or "//".] An initial "/" or "//" is an abbreviation for one or more initial steps that are implicitly added to the beginning of the path expression, as described below.XPath 3.1 XQuery 3.1

[Definition] The formatting of a number is controlled by a picture string. The picture string is a sequence of ·characters·, in which the characters assigned to the properties decimal-separator-sign, exponent-separator-sign, grouping-sign, decimal-digit-family, optional-digit-sign and pattern-separator-sign are classified as active characters, and all other characters (including the percent-sign and per-mille-sign) are classified as passive characters.XPath and XQuery Functions and Operators 3.1 - Problematic because none of the properties decimal-separator-sign, etc. are defined in XPath and XQuery Functions and Operators 3.1, nor are they defined in XML 5th edition which is the reference from Char. The Unicode name for decimal-separator-sign is decimal separator so I am not sure where these names came from. Require definition and hopefully a point of origin.

[Definition: A positional variable is a variable that is preceded by the keyword at.] A positional variable may be associated with a variable that is bound in a for clause. In this case, as the main variable iterates over the items in its binding sequence, the positional variable iterates over the integers that represent the ordinal numbers of these items in the binding sequence, starting with one. Each tuple in the output tuple stream contains bindings for both the main variable and the positional variable. If the binding sequence is empty and allowing empty is specified, the positional variable in the output tuple is bound to the integer zero. Positional variables always have the implied type xs:integer. The expanded QName of a positional variable must be distinct from the expanded QName of the main variable with which it is associated [err:XQST0089].XQuery 3.1

[Definition: A pragma is denoted by the delimiters (# and #), and consists of an identifying EQName followed by implementation-defined content.] The content of a pragma may consist of any string of characters that does not contain the ending delimiter #). If the EQName of a pragma is a lexical QName, it must resolve to a namespace URI and local name, using the statically known namespaces [err:XPST0081].XQuery 3.1

[Definition: A predefined entity reference is a short sequence of characters, beginning with an ampersand, that represents a single character that might otherwise have syntactic significance.] Each predefined entity reference is replaced by the character it represents when the string literal is processed. The predefined entity references recognized by XQuery are as follows:XQuery 3.1 XPath 3.1 uses "predefined entity reference" 2 times without an equivalent definition.

[Definition: Primary expressions are the basic primitives of the language. They include literals, variable references, context item expressions, and function calls. A primary expression may also be created by enclosing any expression in parentheses, which is sometimes helpful in controlling the precedence of operators.] Map and Array Constructors are described in 3.11 Maps and Arrays.XPath 3.1

[Definition: Primary expressions are the basic primitives of the language. They include literals, variable references, context item expressions, constructors, and function calls. A primary expression may also be created by enclosing any expression in parentheses, which is sometimes helpful in controlling the precedence of operators.] Node Constructors are described in 3.9 Constructors. Map and Array Constructors are described in 3.10 Maps and Arrays.XQuery 3.1 note addition of "constructors." And note like remarks.

[Definition: There are 21 primitive simple types: the 19 defined in Section 3.2 Primitive datatypesXS2 of [Schema Part 2] and xs:untypedAtomic and xs:anyAtomicType ], defined in 2.7 Schema Information. XDM

[Definition: Every axis has a principal node kind. If an axis can contain elements, then the principal node kind is element; otherwise, it is the kind of nodes that the axis can contain.] Thus:XPath 3.1 XQuery 3.1

[Definition: A private function is a function with a %private annotation. A private function is hidden from module import, which can not import it into the statically known function signatures of another module.XQuery 3.1

[Definition: A private variable is a variable with a %private annotation. A private variable is hidden from module import, which can not import it into the in-scope variables of another module.XQuery 3.1

[Definition: A Prolog is a series of declarations and imports that define the processing environment for the module that contains the Prolog.] Each declaration or import is followed by a semicolon. A Prolog is organized into two parts. XQuery 3.1

Definition: A public function is a function without a %private annotation. A public function is accessible to module import, which can import it into the statically known function signatures of another module. ] Using %public and %private annotations in a main module is not an error, but it does not affect module imports, since a main module cannot be imported. It is a static error [err:XQST0106] if a function declaration contains both a %private and a %public annotation, more than one %private annotation, or more than one %public annotation.XQuery 3.1

Definition: A public variable is a variable without a %private annotation. A public variable is accessible to module import, which can import it into the in-scope variables of another module. Using %public and %private annotations in a main module is not an error, but it does not affect module imports, since a main module cannot be imported. It is a static error [err:XQST0116] if a variable declaration contains both a %private and a %public annotation, more than one %private annotation, or more than one %public annotation.]XQuery 3.1

[Definition: A pure union type is an XML Schema union type that satisfies the following constraints: (1) {variety} is union, (2) the {facets} property is empty, (3) no type in the transitive membership of the union type has {variety} list, and (4) no type in the transitive membership of the union type is a type with {variety} union having a non-empty {facets} property].XPath 3.1 XQuery 3.1

[Definition: The Query Body, if present, consists of an expression that defines the result of the query.] Evaluation of expressions is described in 3 Expressions. A module can be evaluated only if it has a Query Body.XQuery 3.1

[Definition: To resolve a relative URI $rel against a base URI $base is to expand it to an absolute URI, as if by calling the function fn:resolve-uri($rel, $base).] During static analysis, the base URI is the Static Base URI. During dynamic evaluation, the base URI used to resolve a relative URI reference depends on the semantics of the expression.XPath 3.1 XQuery 3.1

Definition: The node ordering that is the reverse of document order is called reverse document order.]XPath 3.1 XQuery 3.1

[Definition: The root node is the topmost node of a tree, the node with no parent.] Every tree has exactly one root node and every other node can be reached from exactly one root node. XDM

[Definition] Within a map, no two entries have the same key. Two atomic values K1 and K2 are the same key for this purpose if the relation deep-equal(K1, K2, $UCC) holds, where $UCC is the Unicode codepoint collation.XPath and XQuery Functions and Operators 3.1 Curious, does "Unicode codepoint collation" mean the locally defined "Unicode codepoint collaction? Without a reference to the "local" definition, I suspect this is a trap for the unwary.

[Definition: Two atomic values K1 and K2 have the same key value if the relation deep-equal(K1, K2, $UCC) holds, where $UCC is the Unicode codepoint collation.] If two or more entries have the same key value then a dynamic error is raised [err:XQDY0137].XPath 3.1 XQuery 3.1

[Definition: The Schema Aware Feature permits the query Prolog to contain a schema import, and permits a query to contain a validate expression (see 3.19 Validate Expressions). ]XQuery 3.1

[Definition: A schema import imports the element declarations, attribute declarations, and type definitions from a schema into the in-scope schema definitions. For each named user-defined simple type in the schema, schema import also adds a corresponding constructor function. ] The schema to be imported is identified by its target namespace. The schema import may bind a namespace prefix to the target namespace of the imported schema, adding the (prefix, URI) pair to the statically known namespaces, or it may declare that target namespace to be the default element/type namespace. The schema import may also provide optional hints for locating the schema.XQuery 3.1 XPath 3.1 uses "schema import four (4) times without an equivalent definition.

[Definition: A schema type is a type that is (or could be) defined using the facilities of [XML Schema 1.0] or [XML Schema 1.1] (including the built-in types of [XML Schema 1.0] or [XML Schema 1.1]).] A schema type can be used as a type annotation on an element or attribute node (unless it is a non-instantiable type such as xs:NOTATION or xs:anyAtomicType, in which case its derived types can be so used). Every schema type is either a complex type or a simple type; simple types are further subdivided into list types, union types, and atomic types (see [XML Schema 1.0] or [XML Schema 1.1] for definitions and explanations of these terms.)XPath 3.1 XQuery 3.1

Definition: A sequence is an ordered collection of zero or more items.XPath 3.1 XQuery 3.1

[Definition: A sequence is an ordered collection of zero or more items.] A sequence cannot be a member of a sequence. A single item appearing on its own is modeled as a sequence containing one item. Sequences are defined in 2.5 Sequences. XDM

[Definition: A sequence type is a type that can be expressed using the SequenceType syntax. Sequence types are used whenever it is necessary to refer to a type in an XQuery 3.1 expression. The term sequence type suggests that this syntax is used to describe the type of an XQuery 3.1 value, which is always a sequence.]XPath 3.1 differ only with XQuery for XPath XQuery 3.1

[Definition: SequenceType matching compares the dynamic type of a value with an expected sequence type. ] For example, an instance of expression returns true if the dynamic type of a given value matches a given sequence type, or false if it does not.XPath 3.1 XQuery 3.1

[Definition: Serialization is the process of converting an XDM instance to a sequence of octets (step DM4 in Figure 1.), as described in [XSLT and XQuery Serialization 3.1].]XQuery 3.1 XPath 3.1 uses "serialization" four (4) times without an equivalent definition.

[Definition: The Serialization Feature provides means for serializing the result of a query as specified in 2.2.4 Serialization.] A conforming XQuery implementation that provides the Serialization Feature MUST conform to 2.2.4 Serialization. An implementation MAY provide other forms of serialization, which do not conform to the Serialization Feature, and are beyond the scope of this specification.XPath 3.1 XQuery 3.1

[Definition: Setters are declarations that set the value of some property that affects query processing, such as construction mode, ordering mode, or default collation.] Namespace declarations and default namespace declarations affect the interpretation of lexical QNames within the query. Imports are used to import definitions from schemas and modules.XQuery 3.1

[Definition: A sequence containing exactly one item is called a singleton.] An item is identical to a singleton sequence containing that item. Sequences are never nested-for example, combining the values 1, (2, 3), and ( ) into a single sequence results in the sequence (1, 2, 3).XPath 3.1XQuery 3.1

[Definition: A singleton focus is a focus that refers to a single item; in a singleton focus, context item is set to the item, context position = 1 and context size = 1.]XPath 3.1 XQuery 3.1

Definition: Document order is stable, which means that the relative order of two nodes will not change during the processing of a given query, even if this order is implementation-dependent.XPath 3.1 XQuery 3.1

[Definition: Document order is stable, which means that the relative order of two nodes will not change during the processing of a given query or transformation, even if this order is implementation-dependent.] XDM adds "transformation."

[Definition: The static analysis phase depends on the expression itself and on the static context. The static analysis phase does not depend on input data (other than schemas).]XPath 3.1 XQuery 3.1

[Definition: Static Base URI. This is an absolute URI, used to resolve relative URI references. ] If E is a subexpression of F then the Static Base URI of E is the same as the Static Base URI of F. There are no constructs in XPath that require resolution of relative URI references during static analysis. The Static Base URI is available during dynamic evaluation by use of the fn:static-base-uri function, and is used implicitly during dynamic evaluation by functions such as fn:doc. Relative URI references are resolved as described in 2.4.6 Resolving a Relative URI Reference.XPath 3.1

[Definition: Static Base URI. This is an absolute URI, used to resolve relative URIs both during static analysis and during dynamic evaluation. ] All expressions within a module have the same static base URI. The Static Base URI can be set using a base URI declaration. The Static Base URI is available during dynamic evaluation by use of the fn:static-base-uri function, and is used implicitly during dynamic evaluation by functions such as fn:doc. Relative URI references are resolved as described in 2.4.6 Resolving a Relative URI Reference.XQuery 3.1

[Definition: The static context of an expression is the information that is available during static analysis of the expression, prior to its evaluation.] This information can be used to decide whether the expression contains a static error.XPath 3.1 XQuery 3.1

[Definition: An error that can be detected during the static analysis phase, and is not a type error, is a static error.] A syntax error is an example of a static error.XPath 3.1 XQuery 3.1

[Definition: A static function call consists of an EQName followed by a parenthesized list of zero or more arguments.XPath 3.1 XQuery 3.1

[Definition: The static type of an expression is the best inference that the processor is able to make statically about the type of the result of the expression.] This specification does not define the rules for type analysis nor the static types that are assigned to particular expressions: the only constraint is that the inferred type must match all possible values that the expression is capable of returning.XPath 3.1 XQuery 3.1

[Definition: The Static Typing Feature is an optional feature of XPath that provides support for static semantics, and requires implementations to detect and report type errors during the static analysis phase.] Specifications that use XPath may specify conformance criteria for use of the Static Typing Feature.XPath 3.1 differs from XQuery 3.1 by adding a comment on conformance.

[Definition: The Static Typing Feature requires implementations to report all type errors during the static analysis phase.]XQuery 3.1

[Definition: Statically known collations. This is an implementation-defined mapping from URI to collation. It defines the names of the collations that are available for use in processing expressions.]XPath 3.1

[Definition: Statically known collations. This is an implementation-defined mapping from URI to collation. It defines the names of the collations that are available for use in processing queries and expressions.XQuery 3.1 adds "queries" to the language.

[Definition: Statically known collections. This is a mapping from strings to types. The string represents the absolute URI of a resource that is potentially available using the fn:collection function. The type is the type of the sequence of nodes that would result from calling the fn:collection function with this URI as its argument.] If the argument to fn:collection is a string literal that is not present in statically known collections, then the static type of fn:collection is node()*.XPath 3.1 XQuery 3.1

[Definition: Statically known decimal formats. This is a mapping from QName to decimal format, with one default format that has no visible name. Each format is used for serializing decimal numbers using fn:format-number().]XPath 3.1 XQuery 3.1

[Definition: 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.] Unless initialized to some other value by an implementation, the value of statically known default collection type is node()*.XPath 3.1 XQuery 3.1

[Definition: Statically known documents. This is a mapping from strings to types. The string represents the absolute URI of a resource that is potentially available using the fn:doc function. The type is the static type of a call to fn:doc with the given URI as its literal argument. ] If the argument to fn:doc is a string literal that is not present in statically known documents, then the static type of fn:doc is document-node()?.XPath 3.1 XQuery 3.1

[Definition: Statically known function signatures. This is a mapping from (expanded QName, arity) to function signatureDM31. ] The entries in this mapping define the set of statically known functions — those functions that are available to be called from a static function call, or referenced from a named function reference. Each such function is uniquely identified by its expanded QName and arity (number of parameters). Given a statically known function's expanded QName and arity, this component supplies the function's signatureDM31, which specifies various static properties of the function, including typesand annotations.XPath 3.1 XQuery 3.1

[Definition: Statically known namespaces. This is a mapping from prefix to namespace URI that defines all the namespaces that are known during static processing of a given expression.] The URI value is whitespace normalized according to the rules for the xs:anyURI type in [XML Schema 1.0] or [XML Schema 1.1]. Note the difference between in-scope namespaces, which is a dynamic property of an element node, and statically known namespaces, which is a static property of an expression.XPath 3.1 XQuery 3.1

[Definition: A step is a part of a path expression that generates a sequence of items and then filters the sequence by zero or more predicates. The value of the step consists of those items that satisfy the predicates, working from left to right. A step may be either an axis step or a postfix expression.] Postfix expressions are described in 3.2 Postfix Expressions.XPath 3.1 XQuery 3.1

[Definition] A string is a sequence of zero or more ·characters·, or equivalently, a value in the value space of the xs:string data type.XPath and XQuery Functions and Operators 3.1.

[Definition: A string is a value in the value space of the xs:string data type; equivalently, it is a sequence of characters.] XDM

Definition: The string value of a node is a string and can be extracted by applying the fn:string function to the node.] Definitions of fn:data and fn:string can be found in [XQuery and XPath Functions and Operators 3.1].XPath 3.1 XQuery 3.1

[Definition: Substitution groups are defined in [XML Schema 1.0] and [XML Schema 1.1] Part 1. Informally, the substitution group headed by a given element (called the head element) consists of the set of elements that can be substituted for the head element without affecting the outcome of schema validation.]XPath 3.1 XQuery 3.1

[Definition: A sequence type A is a subtype of a sequence type B if the judgement subtype(A, B) is true.] When the judgement subtype(A, B) is true, it is always the case that for any value V, (V instance of A) implies (V instance of B).XPath 3.1 XQuery 3.1

[Definition: The use of a value whose dynamic type is derived from an expected type is known as subtype substitution.] Subtype substitution does not change the actual type of a value. For example, if an xs:integer value is used where an xs:decimal value is expected, the value retains its type as xs:integer.XPath 3.1 XQuery 3.1

[Definition: The target namespace of a module is the namespace of the objects (such as elements or functions) that it defines. ]XQuery 3.1

[Definition: Each element node and attribute node in an XDM instance has a type annotation (described in [XQuery and XPath Data Model (XDM) 3.1]). The type annotation of a node is a reference to an XML Schema type. ] The type-name of a node is the name of the type referenced by its type annotation. If the XDM instance was derived from a validated XML document as described in Section 3.3 Construction from a PSVI DM31, the type annotations of the element and attribute nodes are derived from schema validation. XQuery 3.1 does not provide a way to directly access the type annotation of an element or attribute node.XPath 3.1 XQuery 3.1

[Definition: A variable binding may be accompanied by a type declaration, which consists of the keyword as followed by the static type of the variable, declared using the syntax in 2.5.4 SequenceType Syntax.] At run time, if the value bound to the variable does not match the declared type according to the rules for SequenceType matching, a type error is raised [err:XPTY0004]. For example, the following let clause raises a type error because the variable $salary has a type declaration that is not satisfied by the value that is bound to it:XQuery 3.1 XPath 3.1 uses "ype declaration once without definition.

[Definition: A type error may be raised during the static analysis phase or the dynamic evaluation phase. During the static analysis phase, a type error occurs when the static type of an expression does not match the expected type of the context in which the expression occurs. During the dynamic evaluation phase, a type error occurs when the dynamic type of a value does not match the expected type of the context in which the value occurs.]XPath 3.1 XQuery 3.1

[Definition: Under certain circumstances, an atomic value can be promoted from one type to another. Type promotion is used in evaluating function calls (see 3.1.5.1 Evaluating Static and Dynamic Function Calls) and operators that accept numeric or string operands (see B.2 Operator Mapping).] The following type promotions are permitted:XPath 3.1

[Definition: Under certain circumstances, an atomic value can be promoted from one type to another. Type promotion is used in evaluating function calls (see 3.1.5.1 Evaluating Static and Dynamic Function Calls), order by clauses (see 3.11.8 Order By Clause), and operators that accept numeric or string operands (see B.2 Operator Mapping).] The following type promotions are permitted: XQuery 3.1 adds "order by clauses."

[Definition: The Typed Data Feature permits an XDM instance to contain element node types other than xs:untyped and attributes node types other than xs:untypedAtomic.]XQuery 3.1

[Definition: The typed value of a node is a sequence of atomic values and can be extracted by applying the fn:data function to the node.]XPath 3.1

[Definition] The collation URI http://www.w3.org/2005/xpath-functions/collation/codepoint identifies a collation which must be recognized by every implementation: it is referred to as the Unicode codepoint collation (not to be confused with the Unicode collation algorithm).XPath and XQuery Functions and Operators 3.1 To avoid confusion, don't use Unicode where Unicode collation is not intended. Yes?

[Definition: Within this specification, the term URI refers to a Universal Resource Identifier as defined in [RFC3986] and extended in [RFC3987] with the new name IRI.] The term URI has been retained in preference to IRI to avoid introducing new names for concepts such as "Base URI" that are defined or referenced across the whole family of XML specifications.XPath 3.1 XQuery 3.1

[Definition] Within this specification, the term URI refers to Universal Resource Identifiers as defined in [RFC 3986] and extended in [RFC 3987] with a new name IRI. The term URI Reference, unless otherwise stated, refers to a string in the lexical space of the xs:anyURI datatype as defined in [XML Schema Part 2: Datatypes Second Edition].XPath and XQuery Functions and Operators 3.1

[Definition: User defined functions are functions that contain a function body, which provides the implementation of the function as an XQuery expression.] The static context for a function body includes all functions, variables, and namespaces that are declared or imported anywhere in the Prolog, including the function being declared. Its in-scope variables component also includes the parameters of the function being declared. However, its context item static type component is absentDM31.XQuery 3.1

[Definition: In the data model, a value is always a sequence.XPath 3.1 XQuery 3.1

[Definition: A variable reference is an EQName preceded by a $-sign.] An unprefixed variable reference is in no namespace. Two variable references are equivalent if their expanded QNames are equal (as defined by the eq operator). The scope of a variable binding is defined separately for each kind of expression that can bind variables.XPath 3.1 XQuery 3.1

[Definition: Variable values. This is a mapping from expanded QName to value. It contains the same expanded QNames as the in-scope variables in the static context for the expression. The expanded QName is the name of the variable and the value is the dynamic value of the variable, which includes its dynamic type.]XPath 3.1 XQuery 3.1

[Definition: A version declaration can identify the applicable XQuery syntax and semantics for a module, as well as its encoding.] The version number "1.0" indicates the intent that the module be processed by an XQuery 1.0 processor, the version number "3.0" indicates the intent that the module be processed by an XQuery 3.0 processor XQuery 1.0 processor, the version number "3.1" indicates the intent that the module be processed by an XQuery 3.1 processor. If the version declaration is not present or the version is not included in the declaration, an XQuery 3.1 processor assumes a version of "3.1". If an XQuery 3.1 processor processes a module labeled with a version other than "3.1", it must do one of the following:XQuery 3.1

[Definition: In addition to static errors, dynamic errors, and type errors, an XQuery 3.1 implementation may raise warnings, either during the static analysis phase or the dynamic evaluation phase. The circumstances in which warnings are raised, and the ways in which warnings are handled, are implementation-defined.]XPath 3.1 XQuery 3.1

[Definition: A window is a sequence of consecutive items drawn from the binding sequence.] Each window is represented by at least one and at most nine bound variables. The variables have user-specified names, but their roles are as follows:XQuery 3.1

[Definition: The term XDM instance is used, synonymously with the term value, to denote an unconstrained sequence of items in the data model.]XPath 3.1 XQuery 3.1

Definition: An XPath 1.0 Processor processes a query according to the XPath 1.0 specification.]XPath 3.1 XQuery 3.1

[Definition: XPath 1.0 compatibility mode. This value is true if rules for backward compatibility with XPath Version 1.0 are in effect; otherwise it is false. ]XPath 3.1

[Definition: XPath 1.0 compatibility mode. This component must be set by all host languages that include XPath 3.0 as a subset, indicating whether rules for compatibility with XPath 1.0 are in effect. XQuery sets the value of this component to false. ]XQuery 3.1

Definition: An XPath 2.0 Processor processes a query according to the XPath 2.0 specification.XPath 3.1 XQuery 3.1

[Definition: An XPath 3.0 Processor processes a query according to the XPath 3.0 specification.XPath 3.1 XQuery 3.1

Definition: An XQuery 1.0 Processor processes a query according to the XQuery 1.0 specification. ]XQuery 3.1

Definition: An XQuery 3.0 Processor processes a query according to the XQuery 3.0 specification.XQuery 3.1

[Definition: An XQuery 3.1 Processor processes a query according to the XQuery 3.1 specification.XQuery 3.1

[Definition: xs:anyAtomicType is an atomic type that includes all atomic values (and no values that are not atomic). Its base type is xs:anySimpleType from which all simple types, including atomic, list, and union types, are derived. All primitive atomic types, such as xs:decimal and xs:string, have xs:anyAtomicType as their base type.]XPath 3.1 XQuery 3.1

[Definition: xs:dayTimeDuration is derived by restriction from xs:duration. The lexical representation of xs:dayTimeDuration is restricted to contain only day, hour, minute, and second components.]XPath 3.1 XQuery 3.1

[Definition: xs:error is a simple type with no value space, defined in [XML Schema 1.1]. In implementations that support XML Schema 1.1, it can be used in the 2.5.4 SequenceType Syntax to raise errors.]XPath 3.1 XQuery 3.1

[Definition: xs:untyped is used as the type annotation of an element node that has not been validated, or has been validated in skip mode.] No predefined schema types are derived from xs:untyped.XPath 3.1 XQuery 3.1

[Definition: xs:untypedAtomic is an atomic type that is used to denote untyped atomic data, such as text that has not been assigned a more specific type.] An attribute that has been validated in skip mode is represented in the data model by an attribute node with the type annotation xs:untypedAtomic. No predefined schema types are derived from xs:untypedAtomic.XPath 3.1 XQuery 3.1

[Definition: xs:yearMonthDuration is derived by restriction from xs:duration. The lexical representation of xs:yearMonthDuration is restricted to contain only year and month components.]XPath 3.1 XQuery 3.1


Errors or comments to:patrick@durusau.net

Creative Commons License
XPath, XQuery, XQuery and XPath Functions and Operators, XDM - 3.1 - Sorted Definitions Draft Version 0.1 by Patrick Durusau is licensed under a Creative Commons Attribution 4.0 International License.