Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 1.66 KB

the-xs-qname-type.md

File metadata and controls

50 lines (41 loc) · 1.66 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic helpviewer_keywords
The xs:QName Type
Learn how to use the xs:QName type as an XML Schema restriction element or as the member type of a union.
MikeRayMSFT
mikeray
randolphwest
05/05/2022
sql
xml
conceptual
xs:QName type

The xs:QName type

[!INCLUDE SQL Server Azure SQL Database]

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