Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 1.72 KB

File metadata and controls

53 lines (43 loc) · 1.72 KB
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
ignite-2025
helpviewer_keywords
xs:QName type

The xs:QName type

[!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.

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