You can use a much greater range of characters in an SQL identifier than in an XML name. Any character can be used in an SQL identifier delimited by double quotes.
The normative definition of valid XML Name characters is found in the SQL/XML ISO standard. Valid first characters of XML Names are:
Letters, <underscore>, and <colon>
Valid XML Name characters, after the first character, are:
Letters, Digits, <period>, <minus sign>, <underscore>, <colon>, CombiningChars, and Extenders
Note: The XML definition of Letter and Digit is broader than <simple Latin letter> and <digit> respectively.
There are two types of XML names: XML NCName and XML QName. An XML NCName is an XML non-colonized name and contains no colon (:) character. An XML QName is an XML-qualified name that consists of the XML namespace prefix and the local part of the name, separated by a colon (:) character. The namespace prefix and the local part of the name must be XML NCNames. For example, xsd:string is an XML Qname, where xsd is the namespace prefix which must have been declared for a namespace URI, and string is the local part of the name.
There are two types of mapping of SQL identifiers to XML: fully escaped and partially escaped. Fully escaped mapping is used for all SQL identifiers that are derived from an SQL column name, such as in the XMLATTRIBUTES and XMLFOREST functions. Partially escaped mapping is used in all the other cases, such as in the AS clause of the XMLATTRIBUTES, XMLFOREST, and XMLNAMESPACES functions, and in the NAME clause of the XMLELEMENT and XMLPI functions.
XML names that begin with the characters "xml" (in any combination) are reserved by W3C for use in future recommendations and cannot be used.
The following table shows some mapping examples:
|
SQL Identifier |
Fully Escaped XML Name |
Partially Escaped XML Name |
|---|---|---|
|
department |
DEPARTMENT |
DEPARTMENT |
|
"department" |
department |
department |
|
"last name" |
last_x0020_name |
last_x0020_name |
|
"last_xname" |
last_x005F_name |
last_x005F_name |
|
"dept:id" |
dept_x003A_id |
dept:id |
|
":id" |
_x003A_id |
_x003A_id |
|
"xmlcolumn" |
_x0078_mlcolumn |
xmlcolumn |
|
"Xmlcolumn" |
_x0058_mlcolumn |
Xmlcolumn |
|
xmlcolumn |
_x0058_MLCOLUMN |
XMLCOLUMN |
|
Copyright © 2014 CA.
All rights reserved.
|
|