Skip Headers
Oracle® Database SQL Reference
10g Release 2 (10.2)

Part Number B14200-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

Oracle Compliance with SQL/XML:2005

At the time of the release of this documentation, a new edition of SQL/XML, to be known as SQL/XML:2005, is expected but not yet available in final form. This section reflects our best understanding, based on preliminary drafts and accepted change proposals. However, it is not based on the final form of SQL/XML:2005.

The XML datatype in the standard is XML. The Oracle equivalent datatype is XMLType. We consider a feature of the standard to be fully supported if the only difference between Oracle and the standard is the spelling of the datatype name.

Table B-8 lists the XML features of the standard that are fully supported by Oracle.

Table B-8 Fully Supported Features of SQL/XML:2005

Feature ID Feature
X010 XML type
X016 Persistent XML values
X020 XML Concatenation
X031 XMLElement
X032 XMLForest
X034 XMLAgg
X035 XMLAgg: ORDER BY option
X036 XMLComment
X036 XMLPi
X041 Basic table mapping: null absent
X042 Basic table mapping null as nil
X043 Basic table mapping: table as forest
X044 Basic table mapping: table as element
X045 Basic table mapping: with target namespace
X046 Basic table mapping: data mapping
X047 Basic table mapping: metadata mapping
X049 Basic table mapping: hex encoding
X060 XMLParse: Character string input and CONTENT option
X061 XMLParse: Character string input and DOCUMENT option
X070 XMLSerialize: Character string serialization and CONTENT option
X071 XMLSerialize: Character string serialization and DOCUMENT option
X072 XMLSerialize: Character string serialization
X086 XML namespace declarations in XMLTable
X120 XML parameters in SQL routines
X121 XML parameters in external routines
X201 XMLQuery: RETURNING CONTENT
X203 XMLQuery: passing a context item
X204 XMLQuery: initializing an XQuery variable
X221 XML passing mechanism BY VALUE
X251 Persistent XML values of XML(DOCUMENT(UNTYPED)) type
X252 Persistent values of type XML(DOCUMENT(ANY))
X256 Persistent values of XML(DOCUMENT(XMLSCHEMA)) type
X302 XMLTable with ordinality column
X303 XMLTable: column default option
X304 XMLTable: passing a context item
X305 XMLTable: initializing an XQuery variable

Note to Table B-8: Features X041 through X047, basic table mappings: Oracle table mappings are available through a Java interface and through a package. Oracle table mappings have been generalized to map queries and not just tables. To map only a table: SELECT * FROM table_name.

Table B-9 lists the features of SQL/XML:2005 that are partially supported.

Table B-9 Partially Supported Features of SQL/XML:2005

Feature ID, Feature Partial Support
X040, Basic table mapping Oracle supports the following elements of this feature:
  • X041, Basic table mapping: null absent

  • X042, Basic table mapping: null as nil

  • X043, Basic table mapping: table as forest

  • X044, Basic table mapping: table as element

  • X045, Basic table mapping: with target namespace

  • X046, Basic table mapping: data mapping

  • X047, Basic table mapping: metadata mapping

  • X049, Basic table mapping: hex encoding

Oracle does not support the following element of this feature:

  • X048, Basic table mapping: base64 encoding

X060, "XMLParse: character string input and CONTENT option Oracle does not support the {PRESERVE | STRIP} WHITESPACE syntax. The behavior is always STRIP WHITESPACE.
X200, XMLQuery Oracle fully supports the following elements of this feature:
  • X201, XMLQuery: RETURNING CONTENT

  • X203, XMLQuery: passing a context item

  • X204, XMLQuery: initializing an XQuery variable

Oracle does not support the following elements of this feature:

  • X202, XMLQuery: RETURNING SEQUENCE

  • { NULL | EMPTY } ON EMPTY syntax.

  • Mandatory BY {REF | VALUE} in the PASSING clause. (Oracle supports only value semantics.)

X300, XMLTable Oracle does not support reverse axes in the column path expressions. Aside from that restriction, Oracle fully supports the following elements of this feature:
  • X086, XML namespace declarations in XMLTable

  • X302, XMLTable with ordinality column

  • X303, XMLTable: column default option

  • X304, XMLTable: passing a context item

  • X305, XMLTable: initializing an XQuery variable

Oracle does not support the following elements of this feature:

  • X301, XMLTable: derived column list option

  • Mandatory BY {REF | VALUE } in the PASSING clause. Oracle supports only BY VALUE semantics currently.


Table B-10 lists the features of SQL/XML:2005 that are supported through equivalent functionality in Oracle:

Table B-10 Equivalent Functionality for SQL/XML:2005 Features

Feature ID, Feature Equivalent Functionality
X011, Arrays of XML Types In Oracle, array types must be named, whereas in the standard they are anonymous.
X012, Multisets of XML type The Oracle equivalent of a multiset of XML type is a nested table with a single column of XML type.
X013, Distinct types of XML A distinct type can be emulated using an object types with a single attribute.
X014, Attributes of XML type In Oracle, attributes of object types may be of type XMLType, but the syntax for creating object types is nonstandard.
X025, XMLCast Oracle provides equivalents for the following elements of this feature:
  • To cast from XML to a scalar type, use EXTRACTVALUE. If the XML value is typed, the result is in the nearest analog to the XML type, otherwise the result type is VARCHAR(4000). Use CAST to convert to any other scalar type.

  • To cast from a scalar type to XML, pass the scalar value in to XMLQuery and insert it in a document constructor.

Since Oracle has only one XML type, there is no need to cast from XML to XML.

X076, XMLSerialize: VERSION option Use XMLRoot to set the XML version prior to serialization.
X080, Namespaces in XML publishing In the Oracle implementation of XMLElement, XMLAttributes are used to define namespaces (XMLNamespaces is not implemented. However, XMLAttributes is not supported for XMLForest.
X090, XML document predicate In Oracle, you can test whether an XML value is a document by using the ISFRAGMENT method.
X096, XMLExists Use EXISTSNODE to evaluate an XPath, returning 1 if a node is found, 0 if not. XQuery expressions other than XPath expressions are not supported. Also, Oracle supports XPath 1.0 expressions (not XPath 2,0, which is a subset of XQuery).
X121, XML parameters in external routines Oracle supports XML values passed to external routines using a non-standard interface.
X141, IS VALID predicate: data drive case The XMLISVALID method is equivalent to the IS VALID predicate, and supports the data-driven case.
X142, IS VALID predicate: ACCORDING TO clause The XMLISVALID method is equivalent to the IS VALID predicate, and includes the equivalent of the ACCORDING TO clause.
X143, IS VALID predicate: ELEMENT clause The XMLISVALID method is equivalent to the IS VALID predicate, and includes the equivalent of the ELEMENT clause.
X144, IS VALID predicate: schema location The XMLISVALID method is equivalent to the IS VALID predicate, and supports the specification of a schema location for a registered XML Schema.
X145, IS VALID predicate outside check constraints The XMLISVALID method is equivalent to the IS VALID predicate, and may be used outside check constraints.
X151, IS VALID predicate with DOCUMENT option The XMLISVALID method is equivalent to the IS VALID predicate, and performs validation equivalent to the DOCUMENT clause. (XMLISVALID does not support "content" validation.)
X156, IS VALID predicate: optional NAMESPACE with ELEMENT clause The XMLISVALID method is equivalent to the IS VALID predicate, and may be used to validate against an element in any namespace.
X157, IS VALID predicate: NO NAMESPACE with ELEMENT clause The XMLISVALID method is equivalent to the IS VALID predicate, and may be used to validate against an element in the "no name" namespace.
X160, Basic Information Schema for registered XML Schemas The Oracle static data dictionary view ALL_XML_SCHEMAS provides a list of the registered XML schemas that are accessible to the current user. The ALL_XML_SCHEMAS.SCHEMA_URL column corresponds to the standard XML_SCHEMAS.XML_SCHEMA_LOCATION column. The target namespace of the registered XML Schemas can be learned by examining ALL_XML_SCHEMAS.SCHEMA. Oracle has no equivalents for the other columns of the standard's XML_SCHEMAS.
X161, Advanced Information Schema for registered XML Schemas Oracle does not have static data dictionary views corresponding to XML_SCHEMA_NAMESPACES and XML_SCHEMA_ELEMENTS in the standard. However, all the information about registered XML Schemas may be learned by examining the actual XML Schema, which is found in the ALL_XML_SCHEMAS.SCHEMA column. This may also be examined to learn whether a registered XML Schema is nondeterministic, and which of its namespaces and elements are nondeterministic.
X191, XML(DOCUMENT

(XMLSCHEMA)) type

Oracle does not support this syntax. However, a column of a table can be constrained by a registered XML Schema, in which case all values of the column will be of XML(DOCUMENT(XMLSCHEMA)) type.
X221, XML passing mechanism BY VALUE Oracle supports only value semantics, but does not support the explicit BY VALUE clause.
X232, XML(CONTENT(ANY)) type Oracle does not support this syntax as a type modifier, but the Oracle XMLType supports this data type for transient values. Persistent values are of type XML(DOCUMENT(ANY)), which is a subset of XML(CONTENT(ANY)).
X241, RETURNING CONTENT in XML publishing Oracle does not support this syntax. In Oracle, the behavior of the publishing functions (XMLAgg, XMLComment, XMLConcat, XMLElement, XMLForest, and XMLPi) is always RETURNING CONTENT.
X260, XML type, ELEMENT clause Oracle does not support this syntax. However, a column of a table may be constrained by a top-level element in a registered XML Schema.
X262, XML type, optional NAMESPACE with ELEMENT clause Oracle does not support this syntax. However, a column of a table may be constrained by a top-level element in a namespace other than the target namespace of a registered XML Schema.
X263, XML type: NO NAMESPACE with ELEMENT clause Oracle does not support this syntax. However, a column of a table may be constrained by a top-level element in the "no name" namespace of a registered XML Schema.
X264, XML type: schema location Oracle does not support this syntax. However, a column of a table may be constrained by a registered XML Schema that is identified by a schema location.
X271, XMLValidate: data driven case The SCHEMAVALIDATE method is equivalent to XMLValidate, and supports the data-driven case.
X272, XMLValidate: ACCORDING TO clause The SCHEMAVALIDATE method is equivalent to XMLValidate, and may be used to specify a particular registered XML Schema.
X273, XMLValidate: ELEMENT clause The SCHEMAVALIDATE method is equivalent to XMLValidate, and may be used to specify a particular element of a particular registered XML Schema.
X274, XMLValidate: schema location The SCHEMAVALIDATE method is equivalent to XMLValidate, and may be used to specify a particular registered XML Schema by its schema location URL.
X281, XMLValidate with DOCUMENT option The SCHEMAVALIDATE method is equivalent to XMLValidate. SCHEMAVALIDATE performs validation only of XML documents (not content).
X285, XMLValidate: optional NAMESPACE with ELEMENT clause The SCHEMAVALIDATE method is equivalent to XMLValidate, and may be used to specify a particular element in a namespace other than the target namespace of a particular registered XML Schema.
X286, XMLValidate: NO NAMESPACE with ELEMENT clause The SCHEMAVALIDATE method is equivalent to XMLValidate, and may be used to specify a particular element in the "no name" namespace of a particular registered XML Schema.
Xnnn *, XML Text node constructor The Oracle XMLCData function may be used to create a text node.

* The precise feature ID is not known at the time this document is released for publication.

Table B-11 lists the SQL/XML:2003 features that are not supported by Oracle.

Table B-11 Unsupported SQL/XML:2003 Features

Feature ID Feature
X015 Fields of XML type
X030 XMLDocument
X048 Basic table mapping: base64 encoding
X050 Advanced table mapping
X051 Advanced table mapping: null absent
X052 Advanced table mapping: null as nil
X053 Advanced table mapping: table as forest
X054 Advanced table mapping: table as element
X055 Advanced table mapping: with target namespace
X056 Advanced table mapping: data mapping
X057 Advanced table mapping: metadata mapping
X058 Advanced table mapping: base64 encoding of binary strings
X059 Advanced table mapping: hex encoding of binary strings
X065 XMLParse: BLOB input and CONTENT option
X066 XMLParse: BLOB input and DOCUMENT option
X073 XMLSerialize: BLOB serialization and CONTENT option
X074 XMLSerialize: BLOB serialization and DOCUMENT option
X075 XMLSerialize: BLOB serialization
X076 XMLSerialize: VERSION
X077 XMLSerialize: explicit ENCODING option
X078 XMLSerialize: explicit XML declaration
X081 Query-level namespace declarations
X082 XML namespace declarations in DML
X083 XML namespace declarations in DDL
X084 XML namespace declarations in compound statements
X085 Predefined namespace prefixes
X091 XML content predicate
X100 Host language support for XML: CONTENT option
X101 Host language support for XML: DOCUMENT option
X110 Host language support for XML: VARCHAR mapping
X111 Host language support for XML: CLOB mapping
X131 Query-level XMLBINARY clause
X132 XMLBINARY clause in DML
X133 XMLBINARY clause in DDL
X134 XMLBINARY clause in compound statements
X135 XMLBINARY clause in subqueries
X152 IS VALID predicate with CONTENT option
X153 IS VALID predicate with SEQUENCE option
X155 IS VALID predicate: NAMESPACE without ELEMENT clause
X170 XML null handling options
X171 NIL ON NO CONTENT option
X181 XML(DOCUMENT(UNTYPED)) type
X182 XML(DOCUMENT(ANY)) type
X190 XML(SEQUENCE) type
X192 XML(CONTENT(XMLSCHEMA)) type
X202 XMLQuery: RETURNING SEQUENCE
X211 XML 1.1 support
X222 XML passing mechanism BY REF
X231 XML(CONTENT(UNTYPED)) type
X242 RETURNING SEQUENCE in XML publishing
X253 Persistent XML values of XML(CONTENT(UNTYPED)) type
X254 Persistent XML values of XML(CONTENT(ANY)) type
X255 Persistent values of XML(SEQUENCE) type
X257 Persistent values of XML(CONTENT(XMLSCHEMA)) type
X261 XML type: NAMESPACE without ELEMENT clause
X282 XMLValidate: with CONTENT option
X283 XMLVAlidate: with SEQUENCE option
X284 XMLValidate: NAMESPACE without ELEMENT clause
X290 Name and identifier mapping
X301 XMLTable: derived column list option
Xnnn * Host language support for XML: BLOB mapping
Xnnn * Host language support for XML: STRIP WHITESPACE option
Xnnn * Host language support for XML: PRESERVE WHITESPACE option

* The precise feature ID is not known at the time this document is released for publication.