다음을 통해 공유


혼합 형식 및 단순 콘텐츠

적용 대상: SQL Server Azure SQL Database Azure SQL Managed Instance

SQL Server에서는 혼합 형식을 단순 내용으로 제한할 수 없습니다.

예시

아래의 XML 스키마 컬렉션에서 myComplexTypeA 는 혼합 형식으로 비워둘 수 있습니다. 즉, 두 요소의 minOccurs가 모두 0으로 설정되었습니다. myComplexTypeB 선언에서처럼 혼합 형식을 단순 내용으로 제한하려는 시도는 지원되지 않습니다. 따라서 다음 XML 스키마 컬렉션 생성이 실패합니다.

CREATE XML SCHEMA COLLECTION SC AS '
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ns" xmlns:ns="http://ns"
xmlns:ns1="http://ns1">
    <complexType name="myComplexTypeA" mixed="true">
        <sequence>
            <element name="a" type="string" minOccurs="0"/>
            <element name="b" type="string" minOccurs="0" maxOccurs="23"/>
        </sequence>
    </complexType>
    <complexType name="myComplexTypeB">
        <simpleContent>
            <restriction base="ns:myComplexTypeA">
                <simpleType>
                    <restriction base="int">
                        <minExclusive value="25"/>
                    </restriction>
                </simpleType>
            </restriction>
        </simpleContent>
    </complexType>
</schema>
';
GO

참고 항목