혼합 형식 및 단순 콘텐츠

적용 대상:SQL ServerAzure SQL DatabaseAzure SQL Managed Instance

SQL Server는 혼합 형식을 단순 콘텐츠로 제한하는 것을 지원하지 않습니다.

아래의 XML 스키마 컬렉션에서 myComplexTypeA 는 혼합 형식으로 비워둘 수 있습니다. 즉, 두 요소가 모두 0으로 설정되었습니다 minOccurs . 선언에서 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

참고 항목