Bewerken

Delen via


The xs:QName type

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance

SQL Server doesn't support types derived from xs:QName by the use of an XML schema restriction element. Also, SQL Server currently doesn't support union types with QName as a member type.

Example

The following CREATE XML SCHEMA COLLECTION statements can't load the XML schema, because they specify the xs:QName type as a member type of the union:

CREATE XML SCHEMA COLLECTION QNameLimitation1 AS N'
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name="myUnion">
        <xs:union memberTypes="xs:int xs:QName"/>
    </xs:simpleType>
</xs:schema>';
GO

CREATE XML SCHEMA COLLECTION QNameLimitation2 AS N'
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name="myUnion">
        <xs:union memberTypes="xs:integer">
   <xs:simpleType>
    <xs:list itemType="xs:QName"/>
   </xs:simpleType>
  </xs:union>
    </xs:simpleType>
</xs:schema>';
GO

Both statements fail with an error.

See also