Schema约束
名称空间 声明以xmlns或xmlns:作为前缀
<元素名 xmlns:prefixname="URL">
默认名称空间 <元素名 xmls="URL">
引入shema文档
xsi:schemaLocation="名称空间(空格)文档位置"
不使用名称空间引入Schema xsi:noNamespaceSchemaLocation="文档位置"> 注意.xsd与实例文档在同一目录
元素定义<xs:element name="xxx"type="yyy"/>
属性定义<xs:attribute name="xxx"type="yyy"/>
简单元素:只包含字符数据的元素。xs:simpleType
xs:restriction minInclusive maxInclusive enumeration pattern
复杂元素:xs:complexContent
包含子元素 <xs:complexType>
<xs:sequence>
<xs:element name=" "type=" "/>
<xs:element name=" "type=" "/>
</xs:sequence>
</xs:complexType>
只包含文本数据simpleContent
包含字符和文本<xs:complexType mixed="true"> 默认情况mixed值为false
本文介绍了XML Schema的基本概念,包括名称空间声明、Schema文档的引入方式、元素与属性的定义方法等,并详细阐述了简单类型与复杂类型的定义及其限制条件。
6229

被折叠的 条评论
为什么被折叠?



