An example of a simple XML Schema

xiaoxiao2021-03-06  88

We can see that DTD's syntax is quite complex, and it does not meet the standard of XML files, self-contained. In other words, the DTD document itself is not a good form of XML document. The above about DTD is just a profile, the purpose is to help everyone can read the DTD file and create a simple DTD file when necessary, because now Many XML applications are built on DTD. Another instead of DTD is the Schema defined by the W3C, and Schema can be translated into a pattern, outline, plan, plan, and so on from the literal language. Its basic means to make a model for XML documents. The significant benefit of SCHEMA relative to DTD is that the XML Schema document itself is also an XML document, rather than using a self-contained syntax like DTD. This makes it easy for users and developers because you can use the same tool to process XML Schema and other XML information, without having to specifically use special tools for Schema. Schema is easy to understand, knowing that XML syntax, people who rules can immediately understand it. The concept of Schema has been proposed, but the standard of W3C has recently come out, and the corresponding application support has not yet been perfect, but SCHEMA has become a trend of XML development. First we are still from the easiest examples to learn the symnatural structure of Schema:          Tianya Moon Knife Guolong If you define this XML document structure in the form of DTD, you can follow: How do you define it in the form of Schema? See the code below: It can be noted that in Schema, it is also achieved by the definition of elements to the entire document nature. And the definition of content. At the same time, it should be noted that in Schema, the element is determined by its name and content model. The name is the name of the element. This can be understood, and the content model is actually the type of element. Just like in C , we can define a variable, but you must define the type of variable, the type of variable may have a variety of forms, which can be a simple variable (such as C , specified type, bool, int, double , char, etc., can also be a very complicated type (such as a struct or class), in SCHEMA, the type (Type) can be divided into two forms, one is a very simple type, known For Simple, one is a complex type called Complex.

转载请注明原文地址:https://www.9cbs.com/read-122048.html

New Post(0)