XSD 的可能性:
1) You can test the proper hierarchy of the XML nodes. [xsd defines which child should come under which parent, etc, abiding which will be counted as error, in above example, child_two cannot be the immediate child of root, but it is the child of "parent" tag which is in-turn a child of "root" node, there is a hierarchy..]
2)可以定义节点值的数据类型。[在上面的例子中,child _ two 不能有除 number 以外的任何其他数据]
3)您还可以定义自定义 data _ type,[例如,对于节点 <month>,可能的数据可以是12个月中的一个。.因此,您需要在一个新的数据类型中定义所有12个月,并将所有12个月的名称作为枚举值写入。.如果输入 XML 包含这12个值以外的任何值,验证将显示错误。. ]
4) You can put the restriction on the occurrence of the elements, using minOccurs and maxOccurs, the default values are 1 and 1.
XSD:
XSD (XML 模式定义)指定如何正式描述 XML (XML)文档中的元素。 Xml:
XML was designed to 描述资料.It is independent from software as well as hardware.
它强化了以下几点。
-Data sharing.
-Platform independent.
- 提供更多资料。
Differences:
XSD 是基于 XML 编写的。
XSD 定义可以出现在文档中的元素和结构,而 XML 不能。
XSD ensures that the data is properly interpreted, while XML does not.
Basically an XSD file defines how the XML file is going to look like. It's a 架构文件 which defines the structure of the XML file. So it specifies what the possible fields are and what size they are going to be.
XML 比 f.ex 有更广泛的应用。超文本标示语言。它没有内在的或默认的“应用程序”。因此,虽然您可能并不真正关心网页也是由允许的内容来管理的,但是从作者的角度来看,您可能希望精确地定义 XML 文档可以包含和不可以包含的内容。
It's like designing a database.
The thing about XML technologies is that they are textual in nature. With XSD, it means you have a data structure definition framework that can be "plugged in" to text processing tools like PHP. So not only can you manipulate the data itself, but also very easily change and document the structure, and even auto-generate front-ends.