It is a static error if a function or variable declared in a library module is not in the target namespace of the library module.
It is a static
error if two or more variables declared or imported by a
module have equal expanded QNames (as
defined by the eq
operator.)
It is a dynamic error if the dynamic type of the
operand of a treat
expression does not match the
sequence type
specified by the treat
expression. This error might
also be raised by a path expression beginning with "/
"
or "//
" if the context node is not in a tree that is
rooted at a document node. This is because a leading
"/
" or "//
" in a path expression is an
abbreviation for an initial step that includes the clause
treat as document-node()
.
It is a static error if the expanded QName for an AtomicOrUnionType in a SequenceType is not defined in the in-scope schema types as a generalized atomic type.
The type must be the name of a type defined in the in-scope schema
types, and the {variety}
of the type must be
simple
.
(Not currently used.)
It is a dynamic error if a cycle is encountered in the definition of a module's dynamic context components, for example because of a cycle in variable declarations.
It is a static error if a Prolog contains more than one copy-namespaces declaration.
(Not currently used.)
It is a static error if a schema import binds a namespace prefix but does not specify a target namespace other than a zero-length string.
It is a static error if multiple schema imports specify the same target namespace.
It is a static error if an implementation is unable to process a schema or module import by finding a schema or module with the specified target namespace.
It is a static error if the name of a function in a function declaration is not in a namespace (expanded QName has a null namespace URI).
It is a dynamic error if the operand of a validate expression is a document node whose children do not consist of exactly one element node and zero or more comment and processing instruction nodes, in any order.
(Not currently used.)
(Not currently used.)
It is a dynamic error if the value of the name expression in a computed processing instruction constructor is equal to "XML" (in any combination of upper and lower case).
A static error is raised if a Prolog contains more than one ordering mode declaration.
A static error is raised if a Prolog contains more than one default element/type namespace declaration, or more than one default function namespace declaration.
A static error is raised if a Prolog contains more than one construction declaration.
A static error is raised if a Prolog contains more than one boundary-space declaration.
A static error is raised if a Prolog contains more than one empty order declaration.
A static
error is raised if one of the predefined prefixes
xml
or xmlns
appears in a namespace
declaration or a default namespace declaration, or if
any of the following conditions is statically detected in any
expression or declaration:
The prefix xml
is bound to some namespace URI other
than http://www.w3.org/XML/1998/namespace
.
A prefix other than xml
is bound to the namespace
URI http://www.w3.org/XML/1998/namespace
.
The prefix xmlns
is bound to any namespace URI.
A prefix other than xmlns
is bound to the namespace
URI http://www.w3.org/2000/xmlns/
.
A static error is raised if the namespace declaration attributes of a direct element constructor do not have distinct names.
It is a dynamic error if the result of the content expression of a computed comment constructor contains two adjacent hyphens or ends with a hyphen.
(Not currently used.)
It is a dynamic error if the value of the name expression in a computed element or attribute constructor cannot be converted to an expanded QName (for example, because it contains a namespace prefix not found in statically known namespaces.)
An implementation that does not support the Validation Feature
must raise a static
error if it encounters a validate
expression.
It is a static
error if a collation
subclause in an order
by
clause of a FLWOR expression does not identify a
collation that is present in statically known collations.
(Not currently used.)
(Not currently used.)
It is a static error if an extension expression contains neither a pragma that is recognized by the implementation nor an expression enclosed in curly braces.
It is a static
error if the target type of a cast
or
castable
expression is xs:NOTATION
xs:anySimpleType
, or
xs:anyAtomicType
.
It is a static error if a QName used in a query contains a namespace prefix that cannot be expanded into a namespace URI by using the statically known namespaces.
(Not currently used.)
(Not currently used.)
It is a dynamic error if the element validated by a
validate
statement does not have a top-level element
declaration in the in-scope element declarations, if validation
mode is strict
.
It is a static error if the namespace URI in a namespace declaration attribute is a zero-length string, and the implementation does not support [XML Names 1.1].
It is a type
error if the typed value of a copied element or attribute node
is namespace-sensitive when construction
mode is preserve
and copy-namespaces mode is
no-preserve
.
It is a static
error if the encoding specified in a Version Declaration does
not conform to the definition of EncName
specified in
[XML 1.0].
It is a static error if the literal that specifies the target namespace in a module import or a module declaration is of zero length.
It is a static
error if a variable bound in a for
or
window
clause of a FLWOR expression, and its
associated positional variable, do not have distinct names
(expanded
QNames).
It is a static error if a character reference does not identify a valid character in the version of XML that is in use.
An implementation MAY raise a
dynamic error
if an xml:id
error, as defined in [XML ID], is encountered during construction of an
attribute named xml:id
.
An implementation MAY raise a
dynamic error
if a constructed attribute named xml:space
has a value
other than preserve
or default
.
The name of each grouping variable must be equal (by the
eq
operator on expanded QNames) to the name of a variable
in the input tuple stream.
It is a dynamic error if the node-name of a node constructed by a computed element constructor has any of the following properties:
Its namespace prefix is xmlns
.
Its namespace URI is
http://www.w3.org/2000/xmlns/
.
Its namespace prefix is xml
and its namespace URI
is not http://www.w3.org/XML/1998/namespace
.
Its namespace prefix is other than xml
and its
namespace URI is
http://www.w3.org/XML/1998/namespace
.
It is a static error for a decimal-format to specify a value that is not valid for a given property, as described in statically known decimal formats
It is a static error if, for any named or unnamed decimal format, the properties representing characters used in a picture string do not each have distinct values. These properties are decimal-separator-sign, grouping-separator, percent-sign, per-mille-sign, zero-digit, digit-sign, and pattern-separator-sign.
No module may contain more than one ContextItemDecl.
(Not currently used.)
An error is raised if a computed namespace constructor attempts to do any of the following:
Bind the prefix xml
to some namespace URI other
than http://www.w3.org/XML/1998/namespace
.
Bind a prefix other than xml
to the namespace URI
http://www.w3.org/XML/1998/namespace
.
Bind the prefix xmlns
to any namespace URI.
Bind a prefix to the namespace URI
http://www.w3.org/2000/xmlns/
.
Bind any prefix (including the empty prefix) to a zero-length namespace URI.
In an element constructor, if two or more namespace bindings in the in-scope bindings would have the same prefix, then an error is raised if they have different URIs; if they would have the same prefix and URI, duplicate bindings are ignored.
All variables in a window
clause must have distinct
names.
A TypeName that is
specified in a validate
expression must be found in
the in-scope
schema definitions
It is a type error if the content sequence in an element constructor contains a function .
It is a static
error if a function declaration contains both a
%private
and a %public
annotation.
It is a static error if an output declaration occurs in a library module.
It is a static
error if the local name of an output declaration in the
http://www.w3.org/2010/xslt-xquery-serialization
namespace is not one of the serialization parameter names listed in
C.1 Static Context
Components, or if the name of an output declaration
is use-character-maps
.
It is a static error if the same serialization parameter is used more than once in an output declaration.
It is a static error for a query prolog to contain two decimal formats with the same name, or to contain two default decimal formats.
Specifying a VarValue or VarDefaultValue for a context item declaration in a library module is a static error.
It is a static error for a decimal format declaration to define the same property more than once.
It is a static error if the document specified by the option "http://www.w3.org/2010/xslt-xquery-serialization":parameter-document raises a serialization error.
It is a static
error if a variable declaration contains both a
%private
and a %public
annotation, more
than one %private
annotation, or more than one
%public
annotation.
Attempt to cast to a namespace-sensitive type failed because the namespace bindings for the result can not be determined.
In a direct element constructor, the name used in the end tag must exactly match the name used in the corresponding start tag, including its prefix or absence of a prefix.
It is a static error if the implementation is not able to
process the value of an output:parameter-document
declaration to produce an XDM instance.
It is a static error if a feature required by
require-feature
is not supported by the
implementation.
It is a static error if the name of a feature in
require-feature
or prohibit-feature
is
not in the lexical space of QName.
It is a static error if the name of a feature in
require-feature
is not recognized by the
implementation.
It is a static error if the name of a feature in
require-feature
or prohibit-feature
is
not recognized by the implementation.
It is a static
error if an inline function expression is
annotated as %public
or %private
.
It is a static
error if all-extensions
appears in a
require-feature
option declaration.
It is a static error if a given feature is both required and prohibited, directly or indirectly, in a module.
It is a static
error if a feature name that an implementation supports appears
in a prohibit-feature
option declaration, and the
implementation is unable to disable the feature.
An implementation that does not provide the Higher-Order Function Feature MUST raise a static error [err:XQST0129] if it encounters a FunctionTest, dynamic function call, named function reference, inline function expression, or partial function application.
The URIExpr
of a computed namespace constructor is
not a valid instance of xs:anyURI
.
A feature prohibited by prohibit-feature
is used in
this module.
The module
feature can only be required or
prohibited in a main module, not in a library module.
It is a static
error [err:XPST0133] if the namespace URI for an EQName
is http://www.w3.org/2000/xmlns/
.
A processor may raise an error [err:XQST0034] if the modules of a query do not have the same version number.
application/xquery
Media TypeThis Appendix specifies the media type for XQuery Version 1.0. XQuery is a language for querying over collections of data from XML data sources, as specified in the main body of this document. This media type is being submitted to the IESG (Internet Engineering Steering Group) for review, approval, and registration with IANA (Internet Assigned Numbers Authority.)
This document, found at http://www.w3.org/TR/xquery/,
together with its normative references, defines the language XQuery
Version 1.0. This Appendix provides information about the
application/xquery
media type, which is intended to be
used for transmitting queries written in the XQuery language.
This document was prepared by members of the W3C XML Query Working Group. Please send comments to<EMAIL_ADDRESS>a public mailing list with archives at http://lists.w3.org/Archives/Public/public-qt-comments.
application/xquery
MIME media type name: application
MIME subtype name: xquery
Required parameters: none
Optional parameters: none
The syntax of XQuery is expressed in Unicode but may be written
with any Unicode-compatible character encoding, including UTF-8 or
UTF-16, or transported as US-ASCII or ISO-8859-1 with Unicode
characters outside the range of the given encoding represented
using an XML-style ෝ
syntax.
The public XQuery Web page lists more than two dozen implementations of the XQuery language, both proprietary and open source.
This new media type is being registered to allow for deployment of XQuery on the World Wide Web.
The most common file extensions in use for XQuery are
.xq
and .xquery
.
The appropriate Macintosh file type code is
TEXT
.
For use with transports that are not 8-bit clean, quoted-printable encoding is recommended since the XQuery syntax itself uses the US-ASCII-compatible subset of Unicode.
An XQuery document may contain an encoding declaration as part of its version declaration:
xquery version "1.0" encoding "utf-8";
An XQuery file may have the string xquery version
"V.V"
near the beginning of the document, where
"V.V"
is a version number. Currently the version
number, if present, must be "1.0"
.
XQuery documents use the Unicode character set and, by default, the UTF-8 encoding.
Queries written in XQuery may cause arbitrary URIs or IRIs to be
dereferenced. Therefore, the security issues of [RFC3987] Section 8 should be considered. In
addition, the contents of resources identified by
file:
URIs can in some cases be accessed, processed
and returned as results. XQuery expressions can invoke any of the
functions defined in [XQuery and
XPath Functions and Operators 3.0]. For example, the
fn:doc()
and fn:doc-available()
functions
allow local filesystem probes as well as access to any URI-defined
resource accessible from the system evaluating the XQuery
expression.
XQuery is a full declarative programming language, and supports user-defined functions, external function libraries (modules) referenced by URI, and system-specific "native" functions.
Arbitrary recursion is possible, as is arbitrarily large memory usage, and implementations may place limits on CPU and memory usage, as well as restricting access to system-defined functions.
The XML Query Working group is working on a facility to allow XQuery expressions to create and update persistent data. Untrusted queries should not be given write access to data.
Furthermore, because the XQuery language permits extensions, it
is possible that application/xquery
may describe
content that has security implications beyond those described
here.
In the operator mapping tables, the term Gregorian refers
to the types xs:gYearMonth
, xs:gYear
,
xs:gMonthDay
, xs:gDay
, and
xs:gMonth
.
NaN specifies the string used for the NaN-symbol, which is used to represent the value NaN (not-a-number); the default value is the string "NaN"
A Prolog is a series of declarations and imports that define the processing environment for the module that contains the Prolog.
SequenceType matching compares the dynamic type of a value with an expected sequence type.
Static Base URI. This is an absolute URI, used to resolve relative URIs both during static analysis and during dynamic evaluation.
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 XDM instance is used, synonymously with the term value, to denote an unconstrained sequence of items in the data model.
An XPath 1.0 Processor processes a query according to the XPath 1.0 specification.
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
.
An XPath 2.0 Processor processes a query according to the XPath 2.0 specification.
An XPath 3.0 Processor processes a query according to the XPath 3.0 specification.
An XQuery 1.0 Processor processes a query according to the XQuery 1.0 specification.
An XQuery 3.0 Processor processes a query according to the XQuery 3.0 specification.
An argument to a function call is either an argument expression or an ArgumentPlaceholder ("?").
Argument expressions are evaluated with respect to DC , producing argument values.
The number of Argument
s in an
ArgumentList
is its arity.
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].
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.0].
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.
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.
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.
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.
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.
A base URI declaration specifies the Static Base URI property. The Static Base URI property is used when resolving relative URI references.
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.
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.
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.
Boundary-space policy. This component controls the processing of boundary whitespace by direct element constructors, as described in <IP_ADDRESS> Boundary Whitespace.
The built-in functions supported by XQuery 3.0 are defined in [XQuery and XPath Functions and Operators 3.0].
A character reference is an XML-style reference to a [Unicode] character, identified by its decimal or hexadecimal codepoint.
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.0].
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.
A computed element constructor creates an element node, allowing both the name and the content of the node to be computed.
A construction declaration sets the construction mode in the static context, overriding any implementation-defined default.
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
.
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?)
.
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.
The context item is the item currently being processed.
Context item static type. This component defines the static type of the context item within the scope of a given expression.
When the context item is a node, it can also be referred to as the context node.
The context position is the position of the context item within the sequence of items currently being processed.
The context size is the number of items in the sequence of items currently being processed.
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.
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
.
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.
XQuery 3.0 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.0].
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
decimal-separator specifies the character used for the decimal-separator-symbol; the default value is the period character (.)
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.
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.
A default collation declaration sets the value of the default collation in the static context, overriding any implementation-defined default.
Default element/type namespace. This is a namespace URI or absentDM30. The namespace URI, if present, is used for any unprefixed QName appearing in a position where an element or type name is expected.
Default function namespace. This is a namespace URI or absentDM30. The namespace URI, if present, is used for any unprefixed QName appearing in a position where a function name is expected.
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
.
Default node collection. This is the sequence of nodes
that would result from calling the fn:collection
function with no arguments.
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.10.8 Order By Clause.
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.
Default resource collection. This is the sequence of URIs
that would result from calling the fn:uri-collection
function with no arguments.
The delimiting terminal symbols are: S, "!", "!=", StringLiteral, "#", "#)", "$", "%", "(", "(#", ")", "*", "+", (comma), "-", "-->", (dot), "..", "/", "//", "/>", (colon), "::", ":=", (semi-colon), "<", "<!--", "<![CDATA[", "</", "<<", "<=", "<?", "=", ">", ">=", ">>", "?", "?>", "@", BracedURILiteral, "[", "]", "]]>", "{", "|", "||", "}"
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.
digit-sign specifies the character used for the digit-sign in the picture string; the default value is the number sign character (#)
A direct element constructor is a form of element constructor in which the name of the constructed element is a constant.
Informally, document order is the order in which nodes appear in the XML serialization of a document.
The dynamic context of an expression is defined as information that is available at the time the expression is evaluated.
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.
The dynamic evaluation phase is the phase during which the value of an expression is computed.
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).
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.)
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.0].
The effective case of a switch expression is the first case clause that matches, using the rules given above, or the default clause if no such case clause exists.
The effective case in a typeswitch
expression is the first case
clause in which the value
of the operand expression matches a SequenceType in the SequenceTypeUnion of the
case
clause, using the rules of SequenceType matching.
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.
A sequence containing zero items is called an empty sequence.
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
".
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.
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.
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 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.
The expression context for a given expression consists of all the information that can affect the result of the expression.
An extension expression is an expression whose semantics are implementation-defined.
External functions are functions that are implemented outside the query environment.
For two features A and D in the same
namespace, if the local name of feature A contains the
local name of feature D as a leading substring, using
the Unicode codepoint collation
(http://www.w3.org/2005/xpath-functions/collation/codepoint
),
then feature A contains feature
D.
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.
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
).
The first three components of the dynamic context (context item, context position, and context size) are called the focus of the expression.
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.
Function coercion wraps a functionDM30 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.
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.
A generalized atomic type is a type which is either (a) an atomic type or (b) a pure union type
The atomized value of a grouping variable is called a grouping key.
Each grouping specification specifies one grouping variable, which refers to variable bindings in the pre-grouping tuples. The values of the grouping variables are used to assign pre-grouping tuples to groups.
grouping-separator specifies the character used for the grouping-separator-symbol, which is typically used as a thousands separator; the default value is the comma character (,)
The Higher Order Function Feature allows an expression to evaluate to a function, and allows dynamic function calls.
Ignorable whitespace consists of any whitespace characters that may occur between terminals, unless these characters occur in the context of a production marked with a ws:explicit annotation, in which case they can occur only where explicitly specified (see A.2.4.2 Explicit Whitespace Handling).
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.
Implementation-defined indicates an aspect that may differ between implementations, but must be specified by the implementor for each particular implementation.
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.
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.
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.
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.
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.
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.
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.
infinity specifies the string used for the infinity-symbol; the default value is the string "Infinity"
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.
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.
An inline function expression creates an anonymous functionDM30 defined directly in the inline function expression itself.
An item is either an atomic value, a node, or a functionDM30.
An alternative form of a node test called a kind test can select nodes based on their kind, name, and type annotation.
A lexical QName is a name that conforms to the syntax of [http://www.w3.org/TR/REC-xml-names/#NT-QName].
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 literal is a direct syntactic representation of an atomic value.
A main module consists of a Prolog followed by a Query Body.
MAY means that an item is truly optional.
minus-sign specifies the character used for the minus-sign-symbol; the default value is the hyphen-minus character (-, #x2D). The value must be a single character.
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.
The module context for a given module consists of all the information that is accessible to top-level expressions in the module.
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 Module Feature allows a query Prolog to contain a Module Import and allows library modules to be created.
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.
MUST means that the item is an absolute requirement of the specification.
MUST NOT means that the item is an absolute prohibition of the specification.
When an expression is used to specify the name of a constructed node, that expression is called the name expression of the constructor.
A node test that consists only of an EQName or a Wildcard is called a name test.
A named feature is a feature that is associated with a name.
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.
A named function reference denotes a named function.
Named functions. This is a mapping from (expanded QName, arity) to functionDM30.
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.
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.
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.
A node is an instance of one of the node kinds defined in [XQuery and XPath Data Model (XDM) 3.0].
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.
The non-delimiting terminal symbols are: IntegerLiteral, URIQualifiedName, NCName, DecimalLiteral, DoubleLiteral, QName, "NaN", "allowing", "ancestor", "ancestor-or-self", "and", "as", "ascending", "at", "attribute", "base-uri", "boundary-space", "by", "case", "cast", "castable", "catch", "child", "collation", "comment", "construction", "context", "copy-namespaces", "count", "decimal-format", "decimal-separator", "declare", "default", "descendant", "descendant-or-self", "descending", "digit", "div", "document", "document-node", "element", "else", "empty", "empty-sequence", "encoding", "end", "eq", "every", "except", "external", "following", "following-sibling", "for", "function", "ge", "greatest", "group", "grouping-separator", "gt", "idiv", "if", "import", "in", "infinity", "inherit", "instance", "intersect", "is", "item", "lax", "le", "least", "let", "lt", "minus-sign", "mod", "module", "namespace", "namespace-node", "ne", "next", "no-inherit", "no-preserve", "node", "of", "only", "option", "or", "order", "ordered", "ordering", "parent", "pattern-separator", "per-mille", "percent", "preceding", "preceding-sibling", "preserve", "previous", "processing-instruction", "return", "satisfies", "schema", "schema-attribute", "schema-element", "self", "sliding", "some", "stable", "start", "strict", "strip", "switch", "text", "then", "to", "treat", "try", "tumbling", "type", "typeswitch", "union", "unordered", "validate", "variable", "version", "when", "where", "window", "xquery", "zero-digit"
When referring to a type, the term numeric denotes the
types xs:integer
, xs:decimal
,
xs:float
, and xs:double
.
A predicate whose predicate expression returns a numeric type is called a numeric predicate.
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.
An option declaration declares an option that affects the behavior of a particular implementation. Each option consists of an identifying EQName and a StringLiteral.
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.11 Ordered and Unordered
Expressions.
An ordering mode declaration sets the ordering mode in the static context, overriding any implementation-defined default.
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.
A static or dynamic function call is a partial function application if one or more arguments is an ArgumentPlaceholder.
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 "//
".
pattern-separator specifies the character used for the pattern-separator-symbol, which separates positive and negative sub-pictures in a picture string; the default value is the semi-colon character (;)
per-mille specifies the character used for the per-mille-symbol; the default value is the Unicode per-mille character (#x2030)
percent specifies the character used for the percent-symbol; the default value is the percent character (%)
A positional variable is a variable that is preceded by
the keyword at
.
A pragma is denoted by the delimiters (#
and
#)
, and consists of an identifying EQName followed by
implementation-defined
content.
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.
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.
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.
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.
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.
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.
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.
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
A query consists of one or more modules.
The Query Body, if present, consists of an expression that defines the result of the query.
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)
.
The node ordering that is the reverse of document order is called reverse document order.
The Schema Aware Feature permits the query Prolog to
contain a schema
import, and permits a query to contain a validate
expression (see 3.18 Validate
Expressions).
A schema import imports the element declarations, attribute declarations, and type definitions from a schema into the in-scope schema definitions. For each user-defined generalized atomic type in the schema, schema import also adds a corresponding constructor function.
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 sequence is an ordered collection of zero or more items.
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.0 expression. The term sequence type suggests that this syntax is used to describe the type of an XQuery 3.0 value, which is always a sequence.
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.0].
The Serialization Feature provides means for serializing the result of a query as specified in 2.2.4 Serialization.
Setters are declarations that set the value of some property that affects query processing, such as construction mode, ordering mode, or default collation.
SHOULD means that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.
A sequence containing exactly one item is called a singleton.
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.
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.
The Static Typing Feature requires implementations to report all type errors during the static analysis phase.
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).
The static context of an expression is the information that is available during static analysis of the expression, prior to its evaluation.
An error that can be detected during the static analysis phase, and is not a type error, is a static error.
A static function call consists of an EQName followed by a parenthesized list of zero or more arguments.
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.
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()
.
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.
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.
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.
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.
Statically known function signatures. This is a mapping from (expanded QName, arity) to function signatureDM30.
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.
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.
The string value of a node is a string and can be
extracted by applying the fn:string
function to the
node.
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.
A sequence
type A
is a subtype of a sequence type
B
if the judgement subtype(A, B)
is
true.
The use of a value whose dynamic type is derived from an expected type is known as subtype substitution.
Each rule in the grammar defines one symbol, using the following format:
symbol ::= expression
Whitespace and Comments function as symbol separators. For the most part, they are not mentioned in the grammar, and may occur between any two terminal symbols mentioned in the grammar, except where that is forbidden by the /* ws: explicit */ annotation in the EBNF, or by the /* xgc: xml-version */ annotation.
The target namespace of a module is the namespace of the objects (such as elements or functions) that it defines.
A terminal is a symbol or string or pattern that can appear in the right-hand side of a rule, but never appears on the left-hand side in the main grammar, although it may appear on the left-hand side of a rule in the grammar for terminals.
A tuple is a set of zero or more named variables, each of which is bound to a value that is an XDM instance.
A tuple stream is an ordered sequence of zero or more tuples.
Each element node and attribute node in an XDM instance has a type annotation ( described in [XQuery and XPath Data Model (XDM) 3.0]. ) The type annotation of a node is a reference to an XML Schema type.
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.
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.
Under certain circumstances, an atomic value can be promoted
from one type to another. Type promotion is used in
evaluating function calls (see <IP_ADDRESS> Evaluating Static and Dynamic
Function Calls ), order
by
clauses (see 3.10.8
Order By Clause), and operators that accept numeric
or string operands (see B.2 Operator
Mapping).
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.
User defined functions are functions that contain a function body, which provides the implementation of the function as an XQuery expression.
In the data model, a value is always a sequence.
A variable reference is an EQName preceded by a $-sign.
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.
A version declaration can identify the applicable XQuery syntax and semantics for a module, as well as its encoding.
In addition to static errors, dynamic errors, and type errors, an XQuery 3.0 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.
A whitespace character is any of the characters defined by [http://www.w3.org/TR/REC-xml/#NT-S].
A window is a sequence of consecutive items drawn from the binding sequence.
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.
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.
xs:untyped
is used as the type annotation of
an element node that has not been validated, or has been validated
in skip
mode.
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.
xs:yearMonthDuration
is derived by restriction from
xs:duration
. The lexical representation of
xs:yearMonthDuration
is restricted to contain only
year and month components.
zero-digit specifies the character used for the zero-digit-symbol; the default value is the digit zero (0). This character must be a digit (category Nd in the Unicode property database), and it must have the numeric value zero. This attribute implicitly defines the Unicode character that is used to represent each of the values 0 to 9 in the final result string: Unicode is organized so that each set of decimal digits forms a contiguous block of characters in numerical sequence.
This section contains examples of several important classes of queries that can be expressed using XQuery. The applications described here include joins across multiple data sources, grouping and aggregation, queries based on sequential relationships, recursive transformations, and selection of distinct combinations of values.
Note:
This section needs to be rewritten in light of the new features of XQuery 3.0, which can significantly simplify some of these queries.
Joins, which combine data from multiple sources into a single result, are a very important type of query. In this section we will illustrate how several types of joins can be expressed in XQuery. We will base our examples on the following three documents:
A document named parts.xml
that contains many
part
elements; each part
element in turn
contains partno
and description
subelements.
A document named suppliers.xml
that contains many
supplier
elements; each supplier
element
in turn contains suppno
and suppname
subelements.
A document named catalog.xml
that contains
information about the relationships between suppliers and parts.
The catalog document contains many item
elements, each
of which in turn contains partno
, suppno
,
and price
subelements.
A conventional ("inner") join returns information from two or more related sources, as illustrated by the following example, which combines information from three documents. The example generates a "descriptive catalog" derived from the catalog document, but containing part descriptions instead of part numbers and supplier names instead of supplier numbers. The new catalog is ordered alphabetically by part description and secondarily by supplier name.
<descriptive-catalog> { for $i in fn:doc("catalog.xml")/items/item, $p in fn:doc("parts.xml")/parts/part[partno = $i/partno], $s in fn:doc("suppliers.xml")/suppliers /supplier[suppno = $i/suppno] order by $p/description, $s/suppname return <item> { $p/description, $s/suppname, $i/price } </item> } </descriptive-catalog>
The previous query returns information only about parts that have suppliers and suppliers that have parts. An outer join is a join that preserves information from one or more of the participating sources, including elements that have no matching element in the other source. For example, a left outer join between suppliers and parts might return information about suppliers that have no matching parts.
The following query demonstrates a left outer join. It returns names of all the suppliers in alphabetic order, including those that supply no parts. In the result, each supplier element contains the descriptions of all the parts it supplies, in alphabetic order.
for $s in fn:doc("suppliers.xml")/suppliers/supplier order by $s/suppname return <supplier> { $s/suppname, for $i in fn:doc("catalog.xml")/items/item [suppno = $s/suppno], $p in fn:doc("parts.xml")/parts/part [partno = $i/partno] order by $p/description return $p/description } </supplier>
The previous query preserves information about suppliers that
supply no parts. Another type of join, called a full outer
join, might be used to preserve information about both
suppliers that supply no parts and parts that have no supplier. The
result of a full outer join can be structured in any of several
ways. The following query generates a list of supplier
elements, each containing nested part
elements for the
parts that it supplies (if any), followed by a list of
part
elements for the parts that have no supplier.
This might be thought of as a "supplier-centered" full outer join.
Other forms of outer join queries are also possible.
<master-list> { for $s in fn:doc("suppliers.xml")/suppliers/supplier order by $s/suppname return <supplier> { $s/suppname, for $i in fn:doc("catalog.xml")/items/item [suppno = $s/suppno], $p in fn:doc("parts.xml")/parts/part [partno = $i/partno] order by $p/description return <part> { $p/description, $i/price } </part> } </supplier> , (: parts that have no supplier :) <orphan-parts> { for $p in fn:doc("parts.xml")/parts/part where fn:empty(fn:doc("catalog.xml")/items/item [partno = $p/partno] ) order by $p/description return $p/description } </orphan-parts> } </master-list>
The previous query uses an element constructor to enclose its
output inside a master-list
element. The concatenation
operator (",") is used to combine the two main parts of the query.
The result is an ordered sequence of supplier
elements
followed by an orphan-parts
element that contains
descriptions of all the parts that have no supplier.
XQuery uses the <<
and >>
operators to compare nodes based on document order. Although these
operators are quite simple, they can be used to express complex
queries for XML documents in which sequence is meaningful. The
first two queries in this section involve a surgical report that
contains procedure
, incision
,
instrument
, action
, and
anesthesia
elements.
The following query returns all the action
elements
that occur between the first and second incision
elements inside the first procedure. The original document order
among these nodes is preserved in the result of the query.
let $proc := /report/procedure[1] for $i in $proc//action where $i >> ($proc//incision)[1] and $i << ($proc//incision)[2] return $i
It is worth noting here that document order is defined in such a
way that a node is considered to precede its descendants in
document order. In the surgical report, an action
is
never part of an incision
, but an
instrument
is. Since the >>
operator is based on document order, the predicate $i
>> ($proc//incision)[1]
is true for any
instrument
element that is a descendant of the first
incision
element in the first procedure.
For some queries, it may be helpful to declare a function that
can test whether a node precedes another node without being its
ancestor. The following function returns true
if its
first operand precedes its second operand but is not an ancestor of
its second operand; otherwise it returns false
:
declare function local:precedes($a as node(), $b as node()) as boolean { $a << $b and fn:empty($a//node() intersect $b) };
Similarly, a local:follows
function could be
written:
declare function local:follows($a as node(), $b as node()) as boolean { $a >> $b and fn:empty($b//node() intersect $a) };
Using the local:precedes
function, we can write a
query that finds instrument
elements between the first
two incisions, excluding from the query result any
instrument
that is a descendant of the first
incision
:
let $proc := /report/procedure[1] for $i in $proc//instrument where local:precedes(($proc//incision)[1], $i) and local:precedes($i, ($proc//incision)[2]) return $i
The following query reports incisions for which no prior
anesthesia was recorded in the surgical report. Since an
anesthesia
is never part of an incision
,
we can use <<
instead of the less-efficient
local:precedes
function:
for $proc in /report/procedure where some $i in $proc//incision satisfies fn:empty($proc//anesthesia[. << $i]) return $proc
In some documents, particular sequences of elements may indicate
a logical hierarchy. This is most commonly true of HTML. The
following query returns the introduction of an XHTML document,
wrapping it in a div
element. In this example, we
assume that an h2
element containing the text
"Introduction" marks the beginning of the introduction, and the
introduction continues until the next h2
or
h1
element, or the end of the document, whichever
comes first.
let $intro := //h2[text()="Introduction"], $next-h := //(h1|h2)[. >> $intro][1] return <div> { $intro, if (fn:empty($next-h)) then //node()[. >> $intro] else //node()[. >> $intro and . << $next-h] } </div>
Note that the above query makes explicit the hierarchy that was
implicit in the original document. In this example, we assume that
the h2
element containing the text "Introduction" has
no subelements.
Occasionally it is necessary to scan over a hierarchy of elements, applying some transformation at each level of the hierarchy. In XQuery this can be accomplished by defining a recursive function. In this section we will present two examples of such recursive functions.
Suppose that we need to compute a table of contents for a given
document by scanning over the document, retaining only elements
named section
or title
, and preserving
the hierarchical relationships among these elements. For each
section
, we retain subelements named
section
or title
; but for each
title
, we retain the full content of the element. This
might be accomplished by the following recursive function:
declare function local:sections-and-titles($n as node()) as node()? { if (fn:local-name($n) = "section") then element { fn:local-name($n) } { for $c in $n/* return local:sections-and-titles($c) } else if (fn:local-name($n) = "title") then $n else ( ) };
The "skeleton" of a given document, containing only its sections
and titles, can then be obtained by invoking the
local:sections-and-titles
function on the root node of
the document, as follows:
local:sections-and-titles(fn:doc("cookbook.xml"))
As another example of a recursive transformation, suppose that
we wish to scan over a document, transforming every attribute named
color
to an element named color
, and
every element named size
to an attribute named
size
. This can be accomplished by the following
recursive function (note that the element constructor in case
$e
generates attributes before child elements):
declare function local:swizzle($n as node()) as node() { typeswitch($n) case $a as attribute(color) return element color { fn:string($a) } case $es as element(size) return attribute size { fn:string($es) } case $e as element() return element { fn:local-name($e) } { for $c in ($e/@* except $e/@color, (: attr -> attr :) $e/size, (: elem -> attr :) $e/@color, (: attr -> elem :) $e/node() except $e/size ) (: elem -> elem :) return local:swizzle($c) } case $d as document-node() return document { for $c in $d/* return local:swizzle($c) } default return $n };
The transformation can be applied to a whole document by
invoking the local:swizzle
function on the root node
of the document, as follows:
local:swizzle(fn:doc("plans.xml"))
It is sometimes necessary to search through a set of data to
find all the distinct combinations of a given list of properties.
For example, an input data set might consist of a large set of
order
elements, each of which has the same basic
structure, as illustrated by the following example:
<order> <date>2003-10-15</date> <product>Dress Shirt</product> <size>M</size> <color>Blue</color> <supplier>Fashion Trends</supplier> <quantity>50</quantity> </order>
From this data set, a user might wish to find all the distinct
combinations of product
, size
, and
color
that occur together in an order
.
The following query returns this list, enclosing each distinct
combination in a new element named option
:
for $p in fn:distinct-values(/orders/order/product), $s in fn:distinct-values(/orders/order/size), $c in fn:distinct-values(/orders/order/color) order by $p, $s, $c return if (fn:exists(/orders/order[product eq $p and size eq $s and color eq $c])) then <option> <product>{$p}</product> <size>{$s}</size> <color>{$c}</color> </option> else ()
This appendix lists the changes that have been made to this specification since the first publication of the XQuery 1.0 Recommendation.
The following names are now reserved, and cannot appear as function names (see A.3 Reserved Function Names):
function
namespace-node
switch
The following substantive changes have been made.
Pure union types (formerly known as restricted union types) are now permitted in AtomicOrUnionTypes. Resolves Bug 13399.
Adopted the XML restriction that control characters #x1 to #x1F and 0x7F to 0x9F cannot appear in unescaped form in an XQuery. Resolves Bug 14921.
Added available text resources to the static context, as part of the resolution of Bug 14932.
Changed error XQST0046 for URI literals so that it is no longer dependent on the lexical space of xs:anyURI - the error is now raised if the value of a URILiteral or a BracedURILiteral is of nonzero length and is neither an absolute URI nor a relative URI. Resolves Bug 15675.
All function annotations are carried through function coercion. Resolves Bug 15690.
Clarified and extended rules for casting. Resolves Bug 15807.
Modified the scope of grouping variables. Resolves Bug 15728.
Abandoned the special casting rule that prevented atomization for namespace sensitive types. Resolves Bug 16089.
The split of base URI into static base URI and dynamic base URI has been reverted; instead there is simply a note giving implementations freedom to handle base URI as needed in the case where compiled queries are deployed remotely from the source code. Resolves Bug 17595.
A grouping variable is bound to an atomized value. See decision in Teleconference #497 Minutes (member only).
Changed the syntax of EQName to avoid conflicts with potential JSON syntax extensions in future versions. Resolves Bug 15399.
Relaxed rules that required inputs, outputs, and query modules to all use the same versions of XML, XML Names, and XML Schemas for names, characters, attribute value normalization, line-breaks, etc. Resolves Bug 15966.
Function items are now supported for context-dependent functions if they depend only on the static context. Resolves Bug 15912.
Removed error XPDY0229. Resolves Bug 16681.
The default namespace for both options and annotations is now
http://www.w3.org/2012/xquery
. Resolves Bug
16199.
Changed precedence of simple map operator, reorganized text accordingly. Resolves Bug 16197.
Integrated proposals on static and dynamic context from http://lists.w3.org/Archives/Member/w3c-xsl-query/2012May/0118.html. Resolves Bugs 14656, 14375, and 15791.
Clarified errors for variable declarations and function
declarations that have both %private
and
%public
annotations. Resolves Bug 16104
and Bug
19077.
Renamed annotation assertions to function assertions, clarified that an unrecognized assertion has no effect on processing and that an assertion always restricts the set of matched functions (and never extends them). Resolves Bug 17474.
If there is a Comment before the end of a Version Declaration, an implementation must either raise an implementation-defined static error or ignore the commment. Decided in Montreal Face-to-Face, see https://lists.w3.org/Archives/Member/w3c-xsl-query/2012Jul/0081.html.
The namespace URI specified in a default namespace declaration
must not be http://www.w3.org/XML/1998/namespace
or
http://www.w3.org/2000/xmlns/
. Resolves Bug
14930.
Combined the Schema Validation Feature and the Schema Import Feature into one feature, the Schema Aware Feature (see 5.2.3 Schema Aware Feature). Bug 11585.
The serialization feature (see 5.2.6 Serialization Feature) always requires use of the serialization specification. Decided in teleconference #519, 2012-09-18.
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. Decided in
teleconference #519, 2012-09-18.
Higher order functions are now an optional feature. Decided in teleconference #519, 2012-09-18.
If the type name is xs:untyped
, no are created as a
result of validation; the result of validate type xs:untyped
{ $x }
is the value of $x
with all type
annotatins removed. Decided in face-to-face #517, 2012-07-23 to
2012-07-25.
Changed rules for whitespace in URI Literals and Braced URI Literals in 2.4.5 URI Literals. Decided in face-to-face #517, 2012-07-23 to 2012-07-25.
Serialization parameter names are defined by the element names
in the schema in the serialization spec. Error XQST0109 is also
raised if the name of an output declaration is
use-character-maps
. If a serialization option is not
implemented, an implementation must ignore it, without raising an
error. Decided in Teleconference #520 2012-09-25.
An implementation may raise a dynamic error [err:XQDY0074] if the
URIExpr
of a computed namespace constructor is not a
valid instance of xs:anyURI
. Resolves Bug
15675.
Updated the appendix of implementation-defined items.
In E castable as T
, if E
raises a
dyanmic error, castable
returns false
, it
does not "fail". See 3.16.4
Castable.
Adopted rewording of <IP_ADDRESS> Schema Element Test. Resolves Bug 10207.
Corrected rule #17 of <IP_ADDRESS> The judgement subtype-itemtype(Ai, Bi) . Resolves Bug 19425.
Reworked require-feature
and
prohibit-feature
to work cleanly per module. See
4.20 require-feature and
prohibit-feature. Resolves Bug
19602.
Added error [err:XPST0133], which is raised if the namespace
URI for an EQName is http://www.w3.org/2000/xmlns/
, in
the early section on names. Removed duplicate material in the
section on node tests. Resolves Bug
19658.
Clarified meaning of vendor extensions, added definition of named feature, simplified 4.20 require-feature and prohibit-feature using that definition. Resolves Bug 19670.
Allow an XQuery implementation to process an XQuery 1.0 query according to either the XQuery 1.0 specification or the XQuery 3.0 specification. See 4.1 Version Declaration. Resolves Bug 19671.
All modules share the same initial context item, used in the query body and in prologs of all modules. Resolves Bug 19267.
Added row for statically known decimal formats to C.2 Dynamic Context Components. Resolves Bug 19365.
In 4.18 Function Declaration, nonlocal variables for the declared function are empty. Fixes an omission in implementing the resolution of Bug 15791.
In 4.18 Function Declaration, state explicitly that the processed function is added to the named functions component of the dynamic context.
Updated J.1
Incompatibilities to state that three function names are
now reserved (function
, namespace-node
,
and switch
). Fulfils Action A-523-06.
Ai is a subtype of Bi if Ai and Bi are both pure union types, and every type t in the transitive membership of Ai is also in the transitive membership of Bi. Resolves Bug 19504.
Added html-version
and item-separator
to Appendix C.1. Resolves Bug
20267.
Implementations must raise an error if limits are exceeded. Resolves Bug 20310.
The following are some of the editorial changes that have been made.
Introduced the concept of singleton focus, borrowed from XSLT, and used it to clarify context declaration. Resolves Bug 15789.
Reworked much of the prose re functions, to increase clarity and better accommodate dynamic function calls and partial function applications.
Renamed "Module URI" to "the target namespace of a module". Resolves Bug 14368.
Eliminated the undefined term "global variable". Resolves Bug 14369.
Simplified Conformance language. Consistently use "provides a feature" instead of using both "provides" and "supports". Reduce redundant use of the term "conforms to".
Consistently use "absent" for properties with no value in both static and dynamic context.
More consistent use of terminology for raising an error, eliminating other terms (signal, report, raise, throw) that have been used in various versions of this specification over the years.
Improved the definition of static error.
Editorial rewrite of the description of document order.
Corrected several places where EQNames, QNames, and expanded QNames were conflated.
Simplified 3.1.2 Variable References so that it no longer enumerates expressions that bind variables, and merely refers to the static context. This simplifies maintenance of the specification.
Improved the definition of node test.
Removed definition for "depends on a function", which is no longer used.
Removed a dangling note describing an obsolete error for context-sensitive functions in 3.1.6 Named Function References .
Fixed headings in Appendix C that implied that it describes static and dynamic contexts only for modules. Resolves Bug 20350.
The following substantive changes have been made in prior Working Drafts.
Applied all XQuery 2ed errata.
Added group by
clause to FLWOR Expressions
(3.10.7 Group By Clause).
Added tumbling window
and sliding
window
in FLWOR Expressions (3.10.4
Window Clause).
Added count
clause in FLWOR Expressions (3.10.6 Count Clause).
Added allowing empty
in 3.10.2 For Clause, for
functionality similar to outer joins in SQL.
Added 3.15 Try/Catch Expressions for handling dynamic errors and type errors.
Added named function references (3.1.6 Named Function References ).
Added inline function expressions (3.1.7 Inline Function Expressions).
Added dynamic function call (3.2.2 Dynamic Function Call ).
Added <IP_ADDRESS> Function Coercion.
Added 2.5.6 SequenceType Subtype Relationships, moving sequence type subtype judgments into the language specification rather than the formal semantics.
Added private functions (4.18 Function Declaration).
Added switch expressions (3.13 Switch Expression)
Added computed namespace constructors (<IP_ADDRESS> Computed Namespace Constructors).
Added output declarations (2.2.4 Serialization).
Added annotations (4.15 Annotations).
Simplified BNF for FLWOR expressions, changed description of semantics so that each clause is understood as accepting a tuple stream as input, acting on that tuple stream, and producing a tuple stream as output.
Modified validate
expressions to allow validation against a type that is
explicitly specified in the query using the type
keyword.
Extended variable declarations to allow default values for external variables.
Modified 4.1 Version Declaration to add support for XQuery 3.0.
Added 4.10 Decimal Format
Declaration to allow a query to specify formats for
fn:format-number()
. Added corresponding properties to
the static context.
Relaxed constraints on module imports in 4.12 Module Import to allow modules to reference each other without restriction and to remove restrictions on forwards references to global variables.
Modified 4.16 Variable Declaration to clarify type information and remove ambiguities with respect to types.
Removed obsolete Latin-1, using ISO-8859-1 instead. Resolves Bug 7797.
Changed conformance section to make full-axis support mandatory. Added note saying the Working Group has not yet decided which XQuery 3.0 features are optional.
Added normative rules for resolving module URIs to 4.12 Module Import.
Clarified type information available to
derives-from()
in 2.5.5 SequenceType Matching.
Resolves Bug 6513,
Comment #21.
Modified derives-from()
in 2.5.5 SequenceType Matching
to support union types. Resolves Bug
7749.
Added function assertions to function tests.
Removed section on static typing extensions.
Added support for literal URLs in names, using EQNames.
Added support for XML Schema 1.1.
Added support for union types in function arguments.
Allowed serialization options to be specified as an XDM instance using output declarations. See 2.2.4 Serialization. Resolves Bug 9302. Moved serialization options to the static context, with module scope.
Allowed implementations to ignore errors in non-matching case operands. Resolves Bug 9252.
Required validation to check the values of nodes of type xs:NOTATION. Resolves Bug 9816.
Clarified wording on conflicts between function signatures and constructor functions in statically known function signatures.
Fixed an editorial error in which the wrong error was reported for duplicate decimal formats. Resolves Bug 10271.
Added error for duplicate property declarations within a single decimal format declaration. Resolves Bug 10272.
Specified consistency constraints for types and values of default values for external variables. Resolves Bug 10407.
Added missing consistency constraints for statically known
namespaces to 2.2.5
Consistency Constraints (the prefix xmlns
is
not bound to any namespace URI, no prefix is bound to the namespace
URI http://www.w3.org/2000/xmlns/
). Resolves Bug
10700.
The prefixes math
, err
, and
out
are no longer predeclared. Resolves Bug
10681.
Forbid the namespace URI "http://www.w3.org/2000/xmlns/" in constructed namespace nodes. Resolves Bug 10728.
Corrected definition of group by: 1. We now that no two items with different grouping keys are deep equal to each other, 2. We now handle a non-transitivity edge case. Resolves Bug 10733.
Corrected a bug in XQuery Second Edition involving consecutive ' or " characters in attribute content. Resolves Bug 10989.
Adopted rules for abstract elements in substitution groups: abstract elements do not appear in substitution groups, block attributes must be taken into account when building the substitution groups. Resolves Bug 10207.
Changed the rules for static detection of dynamic and type errors in 2.3.1 Kinds of Errors: Independently of whether the Static Typing Feature is in effect, if an implementation can determine during the static analysis phase that a QueryBody , if evaluated, would necessarily raise a dynamic error or that an expression, if evaluated, would necessarily raise a type error, the implementation may (but is not required to) report that error during the static analysis phase.
Clarified that implementation-defined annotations must not be in
any of the following namespaces:
http://www.w3.org/XML/1998/namespace
,
http://www.w3.org/2001/XMLSchema
,
http://www.w3.org/2001/XMLSchema-instance
.
Prohibited implementations from defining annotations or
annotations assertions in reserved namespaces, changing to
MUST NOT. Added
http://www.w3.org/2005/xpath-functions
and
http://www.w3.org/2005/xpath-functions/math
to the
list of prohibited namespaces. Resolves Bug
10865.
Prohibited the xmlns
namespace in EQNames. Resolves
Bug
10869.
Prohibited user defined functions from being declared in the math namespace. Resolves Bug 10883.
Defined the behavior of "depends on" in the presence of function items. Resolves Bug 10885.
Removed default values from annotations. Resolves Bug 11014.
Added missing semantics for EQNames with URILiterals. Resolves Bug 10857.
Added support for private variables. Resolves Bug 10875.
Added support for casting to union types. Resolves Bug 7860.
Eliminated err:XQST0036 - implementations must be able to determine whether a type in the schemas of one module is derived from a type in the schemas of another module. Resolves Bug 12173.
Prohibited reserved namespaces in annotations (in addition to annotation assertions). Resolves Bug 11538.
Required implementations to resolve cycles in module imports, ensuring that a given module is imported only once. Resolves Bug 10863.
In try/catch expressions, only the first catch clause the matches an error needs to be evaluated. Resolves Bug 11171. (This change appeared in an earlier draft, but was not mentioned in the corresponding change log.)
Allowed a URILiteral
in Wildcard
.
(This change appeared in an earlier draft, but was not mentioned in
the corresponding change log.)
How XDM instances are created from sources other than an Infoset or PSVI is implementation-defined. Resolves Bug 12208. (This change appeared in an earlier draft, but was not mentioned in the corresponding change log.)
Clarified use of Static Base URI, Dynamic Base URI per Bug 11561#c6. (This change appeared in an earlier draft, but was not mentioned in the corresponding change log.)
Added err:XQST0118 for start tag / end tag name mismatches. Resolves Bug 11609. (This change appeared in an earlier draft, but was not mentioned in the corresponding change log.)
Adds errors for casts to namepace sensitive types in cast and function conversion rules. Resolves Bug 11964. (This change appeared in an earlier draft, but was not mentioned in the corresponding change log.)
Specified use of "unknown" types, including types from documents and types from other modules. Eliminated err:XQST0036. Resolves Bug 11095. (This change appeared in an earlier draft, but was not mentioned in the corresponding change log.)
Introduced Generalized atomic types, restricted unions in SequenceType to these types.
Added string concatenation operator "con" || "cat" ||
"enate"
Clarified that conformance to the data model or functions and operators requires a definition of every item specified to be implementation-defined, unless that item is part of an optional feature that is not supported by the implementation.
Added prohibit-feature
and
require-feature
declaration options.
Implemented simple mapping operator proposal using "!" operator. Resolves Bug 12951.
Inline function expressions can also have annotations. Resolves Bug 12909.
Changed the ordering of rules in namespace constructors. Resolves Bug 12649.
Changed rules for matching substitution groups. Resolves Bug 10065.
Eliminated redundant errors for duplicate variables in window clauses. Resolves Bug 13680.
Changed XQTY0102 to a dynamic error. Resolves Bug 13289.
A namespace constructor must have a namespace URI of length > 0. Resolves Bug 12738.
Functions and annotations cannot be in the "http://www.w3.org/2012/xquery" namespace.
For a partial function application, a failure in the function conversion rules MUST raise a type error.
Function item coercion is required to raise a type error if there's a mismatch in the number of parameters (expected vs actual). Resolves Bug 14350.
In the triggers for err:XPST0112, broaden the class of functions that can't be referenced by partial function applications and named function references, from "focus-dependent" to "context-dependent built-in".
Added default language, calendar, and place to the dynamic context. Resolves Bug 14995.
Changed namespace handling in option declarations to provide a default namespace.
Expanded definition of XPST0080 so that casting to xs:anySimpleType is also an error. Resolves Bug 19090.
The following are some of the editorial changes that have been made.
Add Note to group-by section on unexpected replication of LET-bindings after grouping. Advises users to use a separate FLWOR to bind the expression, and a nested FLWOR for grouping, like this: let $x := 47 return for $e in //emps group by $d := $e/dept return f($d, $x)
Changed introductory text on the relationship between XQuery and XPath to list the cases where a syntactically valid query can return different results in the two languages - see http://www.w3.org/Bugs/Public/show_bug.cgi?id=7163.
Introduced definitions of scope, global scope, module scope, lexical scope, and dynamic scope to C Context Components.
Fixed names of op:hexBinary-equal
and
op:base64Binary-equal
in B.2
Operator Mapping. Resolves Bug
7048.
Clarified overwriteability of the context item static type, resolving Bug 8875.
Added a definion for resolving a relative URI. Resolves Bug 10571.
Provided a definition for matching a
ParenthesizedItemType
: A ParenthesizedItemType
matches an item if and only if the item matches the ItemType that is in parentheses.
Clarified that defaults are used for missing properties of decimal formats. If a given property is not declared, the default values specified in statically known decimal formats are used. Resolves Bug 10858.
Clarified semantics of decimal formats in which all properties are defaulted. If a format declares no properties, default values are used for all properties. Resolves Bug 10273.
Eliminated the vestigial term user declared function, which was not defined, and used the word user-defined function throughout. Resolves Bug 10466.
Added fn:unparsed-text
,
fn:uri-collection
and
fn:get-environment-variable
to the list of input
sources. Resolves Bug
10503.
Changed terminology for properties with no value, particularly in the case of namespace URIs, using the Data Model's new term absentDM30. Resolves Bug 10683.
Clarified that in-scope variables are augmented by inline function expressions. Resolves Bug 10686.
Corrected several editorial errors involving static context for statically known namespaces. Resolves Bug 10689.
Pulled FunctionTest out into it's own SequenceType matching sub-section. Clarified which default namespace to use throughout. Resolves Bug 10705.
Replaced the term "evaluation order" for describing parentheses. New description: "Parentheses may be used to override the precedence rules". Resolves Bug 10716.
Added functions to the definitions of item, XDM. Resolves Bug 10679.
Eliminated erroneous reference to [err:XPST0081]. Resolves Bug 10680.
Added a note to the introduction, specifying that in most contexts, processors are not required to raise errors if a URI is not lexically valid according to [RFC3986] and [RFC3987]. Resolves Bug 10682.
Made editorial corrections governing the prefix expression for computed namespace nodes. Resolves Bug 10727.
Removed the word "legal", which is no longer used in this specification, replacing with more precise terminology.
Modified definition of public/private functions to make the presence or absence of a %private annotation part of the definition. Resolves Bug 10874.
Fixed an incorrect group by
example. Resolves
Bug
10980.
Corrected an example in I.1 Joins. See http://lists.w3.org/Archives/Public/public-qt-comments/2010Nov/0036.html.
Clarified rules on ItemType Subtype Judgement for functions: annotations in these rules are optional, the rules apply even if no annotations are present; return types are covariant, function arguments are contravariant.
Modified description of attribute constructors when the name contains a URILiteral.
Clarified that "Evaluating Function Calls" section applies to dynamic function call and partial function application as well. Resolves Bug 10574.
Clarified use of 'URILiteral':NCName as a name in element/attribute construction. Resolves Bug 10857.
Clarified relationship of conformance to XDM, F&O conformance items. Resolves Bug 13073.
Eliminated the phrase "query module", which was not well-defined.
Added example for decimal format declaration. Resolves Bug 10859.
Clarified contributions of schema import, module import and module declaration to the statically known namespaces. Resolves Bug 8265.
Renamed LiteralFunctionItem as NamedFunctionRef. (3.1.6 Named Function References )
Removed the concept of "scope" defined in Appendix C. Resolves Bug 10368.
Changed the definition of subtype, which is now based on subtype(A,
B)
. Changed the titles of corresponding sections that
describe judgements.


Traffic * * * * out of * * * * Starring: Benicio Del Toro, Michael Douglas, Don Cheadle, Catherine Zeta-Jones, Erika Christensen, Luis Guzman, Jacob Vargas, Dennis Quaid, Amy Irving, Topher Grace, Miguel Ferrer, Steven Bauer, James Brolin, Benjamin Bratt, Tomas Milian, Albert Finney. Directed by: Steven Soderbergh Rated R: strong drug content, violence, language, sexuality, some nudity. Running Time: 147 minutes
Steven Soderbergh's "Traffic" is so good, that I don't think any word in my mouth could describe the perfectness of this film. In the style of "Nashville" or "Magnolia," "Traffic" is based on a miniseries that played on BBC in 1989. The gritty content, and the shaky camerawork will definitely turn off some viewers, but for the others, they will walk out of "Traffic" with their mind working overtime, thinking about what they just saw.
The film consists of different plots, each their own, and each brilliant and insightful, the first has Javier Rodriguez (Benecio Del Toro) and Manola Sanchez (Jacob Vargas), two cops out to bust a cocaine smugglers in Tijuana. After the plan is unsuccessful thanks to the General, they are hired to find an assassin who is linked to a wealthy drug dealer Carlos Ayala (Steven Bauer).
 After her son is threatened by someone linked to the business, Helena who is six months pregnant with their second child, is forced to find $3 million dollars, to keep their son's life safe, and theirs as well. In an attempt to save their lives, Helena becomes the caretaker of her husband's business.
Michael Douglas is Ohio Supreme Court Justice Robert Wakefield the newly appointed Drug Czar for Washington, DC. Trying to crackdown on the drug war, his daughter Caroline (newcomer Erika Christensen) is a drug addict herself, and along with her boyfriend Seth (Topher Grace off "That 70's Show) tries to keep this habit a secret from her father.
DEA Agents Ray Castro and Montel Gordon, who's key witness in the case against Carlos Ayala, the two must keep an eye out on Helena, and her home. Not knowing she has taken over her husbands drug dealing business. The two here seem to keep the film's comic relief alive, and somewhat moderate throughout the film.
Steven Soderbergh has created an American Masterpiece, and there is so much going on in this film, that after it was over I was ready to watch it again to see if I missed anything. After his successful year last year with "Erin Brockovich" which to me was on par with this film, his talent continues to show, especially in this film. His use of different colors for each story is pure brilliance, and complete originality, the use of the camera, the graininess throughout the film, and the style to which he directs his fantastic.
The cast is another story all together, every single person in this movie is amazing in their own way, to start Michael Douglas gives one of his best performances to date and he graces the screen and shows that he is a true actor. As his daughter newcomer Erika Christensen is realistic and true to her role, as the tormented teen. Amy Irving has not been seen on the screen for a while, but she proves she is a great actress, and her performance is almost heartbreaking. Catherine-Zeta Jones gives her best performance, after her dreary performance in 1999's "The Haunting", she comes back with force and shows to be a beautiful, wonderful actress. Dennis Quaid although not seen throughout the film that much, gives a good performance, but to me isn't given enough to do.
Don Cheadle and Luis Guzman are equally great in their roles, and they provide wonderful comic relief for the audience, and for the movie as well. Their chemistry onscreen is natural, and two seem to be having fun with their roles. Possibly the best performance in the film comes from Benicio Del Toro, who after last year's flop "The Way of the Gun" gives an absolute excellent performance, his eye movements, his body movements, his dialogue and the way it comes out of his mouth, this is my pick for the best male performance of 2000.
The brilliantly written script by Stephen Gaghan is expertly crafted, beautifully thought out, and the dialogue is great as well. Stephen Soderbergh's "Traffic" to me can rank up there with mosaic's such as "Nashville" and "Magnolia", its study of the character's and their lives is that of nothing ever seen before. Prepare for Traffic, its going to be heavy today. One of the best, and most powerful films of 2000.
Reviewed by Brandon Herring, 1/5/01.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


public class Vector
extends java.lang.Object
| Constructor and Description |
|---|
Vector()
Empty constructor
|
Vector(double length,
double angle)
Constructor for class Vector, takes polar coordinates.
|
Vector(Vector v)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
Vector |
add(Vector v)
Add a vector to this and return result
|
double |
angleBetween(Vector v) |
static Vector |
create(double x,
double y)
Functions simiar to the constructor but takes the values in cartesian form instead
|
double |
distance(Vector v) |
double |
dotProduct(Vector v)
The dot product of this vector and v
|
double |
getAngle() |
double |
getLength() |
double |
getX() |
double |
getY() |
Vector |
rotate(double d) |
Vector |
scale(double c)
Creates a copy of the vector and scales it by c, returning the result
|
void |
setAngle(double angle) |
void |
setCoordinates(double x,
double y)
Set the coordinates in cartesian form
|
void |
setLength(double length) |
void |
setX(double x) |
void |
setY(double y) |
Vector |
subtract(Vector v)
Get the difference between two vector
|
void |
updateCartesian()
Private function updating cartesian values when changing in polar form
|
void |
updatePolar()
Private function updating polar values when changing in cartesian form
|
public Vector(double length, double angle)
length
- lengthangle
- angle in radianspublic Vector()
public Vector(Vector v)
v
- public double getX()
public void setX(double x)
x
- new x component valuepublic double getY()
public void setY(double y)
y
- new y component valuepublic void setCoordinates(double x, double y)
x
- y
- public double getAngle()
public double getLength()
public void setLength(double length)
length
- new lengthpublic Vector scale(double c)
c
- public final void setAngle(double angle)
angle
- new angle in radianspublic Vector rotate(double d)
d
- angle in radian to rotate withpublic static Vector create(double x, double y)
x
- y
- public final void updatePolar()
public final void updateCartesian()
public Vector add(Vector v)
v
- Vector to add $return Vectorpublic Vector subtract(Vector v)
v
- public double distance(Vector v)
v
- to compare withpublic double dotProduct(Vector v)
v
- public double angleBetween(Vector v)
v
-


{% extends "base.html" %} {% block content %}
Hey! I'm Kanishk, and I created Diomedes to get the best seats in the theaters as soon as they open ticket sales. BookMyShow's notifications are slow and not accurate. But this website allows you to get alerts as soon as the theater you select starts ticket sales.
You can select a maximum of 5 theaters. This is done to ensure that each alert is safely fulfilled.
Meaning of the name:
Diomedes (Diomēdēs) was the commander of 80 Argive ships and one of the most respected leaders in the Trojan War. His famous exploits include the wounding of Aphrodite, the slaughter of Rhesus and his Thracians, and seizure of the Trojan Palladium, the sacred image of the goddess Pallas Athena that protected Troy.


You successfully registred
This mail is alredy exist
Please fill all fileds correctly!
Please finish up registration


CSE 135 Examples
AJAX and Javascript
Simple AJAX
AJAX with XML response
AJAX with JSON response
README
Project on GitHub


| DOSE: |
20 g |
oral |
Kratom |
(daily) |
First off, I want to say that Kratom is a miracle plant.
I have been using kratom very regularly for nearly two years now. Sometimes I use Kratom every day.
I have experimented by taking 20 grams crushed leaf EVERY DAY for one month and then quit abruptly. I stayed off the Kratom for one week and found that I had NO physical withdrawal symptoms.
I did have an urge to take Kratom though. The reason for this, I believe, is due to its medicinal qualities, not any addictive properties.
I have suffered with a medium level of depression my whole adult life. Kratom has cured me of my depression and I therefore do not want to discontinue taking my medicine.
Here is a list of the great things that Kratom has done for me:
1) Kratom makes me more social and thus reduces my use of alcohol to make me more comfortable in social situations.
2) Kratom eliminates my depression. I only take one dose in the evening and the elimination of my depression lasts 24 hours.
3) I often suffer from very annoying allergies (hay fever) and Kratom completely eliminates my hay fever. It works much, much better than OTC antihistamines.
4) Kratom gives me physical energy which often comes in very handy as I am a musician and often have to stay out late and lug around lots of equipment.
The only negative side effect that I have found is that I very occasionally get nausea when I eat while under the influence of Kratom. On the off chance that I do vomit, this act immediately makes me feel 100% better (It is not like alcohol where I keep puking until I dry heave and I still feel sick)
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.