2 Basics


This section describes how DataDirect XQuery supports the following XQuery basics.

Expression Context

Table A-1 describes the XQuery expression context for DataDirect XQuery.

Table A-1. XQuery Expression Context 
XQuery Language
Support
Static context
 
XPath 1.0 compatibility mode
This setting is always false as required by the XQuery specification.
 
Statically known namespaces
Supported. See Namespaces for details on predefined namespaces.
 
Default element/type namespace
The default value is no namespace. This value can be set in the query prolog.
 
Default function namespace
The default value is http://www.w3.org/2005/
xpath-functions. This value can be set in the query prolog.
 
In-scope schema definitions
Only predeclared types are supported. See Supported XQuery Atomic Types for a list of supported types.
 
In-scope variables
This is determined by the XQuery expression.
 
Context item static type
Supported except for initial context item.
 
Function signatures
See Functions and Operators for a list of supported XQuery functions. User-defined functions are also supported.
 
Statically known collations
The collations supported by the Java Virtual Machine.
 
Default collation
Either the Java Virtual Machine collation or the one specified in the source configuration file.
For relational sources, the default value is the collation used by the database. To ensure consistency, make sure that the collation used by the Java Virtual Machine is compatible with the collation used by the database. If multiple databases are used, make sure that their collations are compatible.
See Specifying Collations for instructions on specifying collations.
 
Construction mode
Supported with comment:
preserve is supported. strip is not supported.
 
Ordering mode
Supported.
 
Default order for empty sequences
The following algorithm is used:
  1. The default is empty least.
  2. The default is overwritten by the default ordering behavior of the first JDBC connection defined using XQJ or the source configuration file. The default ordering of the first JDBC connection is defined by the database:
DB2: empty greatest
Informix: empty least
Microsoft SQL Server: empty least
Oracle: empty greatest
PostgreSQL: empty greatest
Sybase: empty least
 
Boundary-space policy
The default value is strip (white space is removed during processing). This value may be set in the query prolog.
 
Copy-namespaces mode
inherit,preserve mode is supported.
 
Base URI
Supported. You can set this value in the query prolog or in the DDXQDataSource class by configuring the BaseUri property.
 
Statically known documents
Not supported.
 
Statically known collections
Data types of the data stored in database tables that can be referenced with fn:collection() are statically known although these data types cannot be accessed from within the expression. See Data Type Mappings for a list of supported data types.
 
Statically known default collection type
Not supported.
Dynamic context
 
Context item
Supported, except for initial context item.
 
Context position
Supported. Context-position dependent expressions are compensated for relational sources.
 
Context size
Supported.
 
Variable values
Supported.
 
Function implementations
Supported.
 
Current dateTime
Supported. The current date and time are obtained from the Java Virtual Machine; however, queries executed against relational databases use the current date and time of the database server.
 
Implicit timezone (implementation-defined)
Supported. The timezone is obtained from the Java Virtual Machine; however, queries executed against relational databases use the current timezone of the database server.
 
Available documents
Supported. Available documents include XML files accessed through http:, ftp:, and file: URI schemes using fn:doc().
See XML Data Sources for rules governing URIs.
 
Available collections
Supported. Available collections are determined by which connections are configured. See Specifying Relational Database Tables for details.
 
Default collection
Not supported.

Processing Model

Table A-2 describes how the XQuery processing model relates to DataDirect XQuery.

Table A-2. XQuery Processing Model 
XQuery Language
Support
Data Model Generation
For a description of data model generation from XML, see Data Model Representation of XML Documents.
For a description of data model generation from relational sources, see Data Model Representation of Relational Tables.
Schema import processing
Not supported.
Expression processing
Supported.
Serialization
Supported through XQJ. See Serialization Support for details.
Consistency constraints
DataDirect XQuery adheres to the consistency constraints as listed in this section of the XQuery specification.

Error Handling

Table A-3 describes how DataDirect XQuery handles errors.

Table A-3. Error Handling 
XQuery Language
Support
Error reporting
Supported. The static typing feature is also supported.

Concepts

Table A-4 describes how DataDirect XQuery works with some key concepts defined by XQuery.

Table A-4. XQuery Documents 
XQuery Language
Support
Document order
Supported.
Atomization
Supported.
Effective Boolean value
Supported.
Input sources
URI literals
Supported.

Types

Table A-5 describes how DataDirect XQuery handles XQuery types.

Table A-5. XQuery Types 
XQuery Language
Support
Predefined schema types
Supported. See Supported XQuery Atomic Types for a list of supported atomic types.
Typed value and string value
Supported.
SequenceType syntax
Supported.
SequenceType matching
Supported. For queries evaluated against a relational database, cardinality testing is not performed.

Comments

Table A-6 describes how DataDirect XQuery supports comments.

Table A-6. Comments
XQuery Language
Support
Comments
Supported.