This commit is contained in:
2025-12-21 17:24:54 +08:00
commit e8c50a3d78
660 changed files with 29599 additions and 0 deletions

40
s_day13/books.xsd Normal file
View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
schema约束文件的根标签必须是schema
目标命名空间:类似java中的包名,用来在执行的xml中来导入约束文件
targetNamespace="http://www.example.org/books"
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.org/books"
elementFormDefault="qualified">
<!--
用来定义xml的根标签必须是books
-->
<element name="books">
<!--
声明books是复杂标签
复杂标签:拥有子标签或者属性的标签
-->
<complexType>
<!--
通过sequence标签指定子标签的顺序
用来指定books的子标签有哪些
-->
<sequence>
<element name="book" maxOccurs="3" minOccurs="1">
<!--设置book标签是复杂标签-->
<complexType>
<!--设置book标签的子标签顺序-->
<sequence>
<element name="name" type="string"></element>
<element name="author" type="string"></element>
<element name="price" type="string"></element>
</sequence>
<!--设置book标签有属性叫address-->
<attribute name="address"></attribute>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>