xsd中的限制如何在复杂类型上起作用?

时间:2018-06-25 14:17:23

标签: xml xsd

我有两个xsd文件:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:pt="http://release11.com/PersonType"
           targetNamespace="http://release11.com/LibraryMemberType">
    <xs:import namespace="http://release11.com/PersonType"/>

    <xs:complexType name="LibraryMemberType">
        <xs:complexContent>
            <xs:restriction base="pt:PersonType">
                <xs:sequence>
                    <xs:element name="id" type="xs:positiveInteger"/>
                    <xs:element name="firstName" type="xs:string"/>
                    <xs:element name="lastName" type="xs:string"/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="libraryMember" type="LibraryMemberType" />
</xs:schema>

您能给我一些有关此xsd的有效xml的示例吗?我不确定它的外观

0 个答案:

没有答案