Share via


The xs:QName Type

SQL Server does not support types derived from xs:QName by the use of an XML Schema restriction element. Also, SQL Server currently does not support union types with QName as a member type. 

Example

The following CREATE XML SCHEMA COLLECTION statements cannot 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.