Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 1.53 KB

File metadata and controls

47 lines (38 loc) · 1.53 KB
title Enumeration Facets
description Learn how SQL Server uses enumeration facets to validate XML schemas.
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
enumeration facets

Enumeration facets

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]

[!INCLUDEssNoVersion] rejects XML schemas with types that have pattern facets or enumerations that violate those facets.

Example

The following schema would be rejected, because the featured enumeration value includes a mixed-case value. It would also be rejected because this value violates the pattern value that limits values to only lowercase letters.

CREATE XML SCHEMA COLLECTION MySampleCollection AS '
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ns" xmlns:ns="http://ns">
    <simpleType name="MyST">
       <restriction base="string">
          <pattern value="[a-z]*"/>
       </restriction>
    </simpleType>

    <simpleType name="MyST2">
       <restriction base="ns:MyST">
           <enumeration value="mYstring"/>
       </restriction>
    </simpleType>
</schema>';
GO

See also