| title | The xs:QName Type | |
|---|---|---|
| description | Learn how to use the xs:QName type as an XML Schema restriction element or as the member type of a union. | |
| author | MikeRayMSFT | |
| ms.author | mikeray | |
| ms.reviewer | randolphwest | |
| ms.date | 05/05/2022 | |
| ms.service | sql | |
| ms.subservice | xml | |
| ms.topic | concept-article | |
| ms.custom |
|
|
| helpviewer_keywords |
|
[!INCLUDE SQL Server Azure SQL Database FabricSQLDB]
[!INCLUDEssNoVersion] doesn't support types derived from xs:QName by the use of an XML schema restriction element. Also, [!INCLUDEssNoVersion] currently doesn't support union types with QName as a member type.
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>';
GOBoth statements fail with an error.