In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you the "sample analysis of Schema in XML", which is easy to understand and clear. I hope it can help you solve your doubts. Let the editor lead you to study and study the "sample analysis of Schema in XML".
As we can see, the syntax of DTD is quite complex, and it does not conform to the standards of XML files, forming a system of its own. That is to say, the DTD document itself is not a good form of XML document, the above introduction on DTD is only a brief introduction, the purpose is to help you understand DTD files and create simple DTD files when necessary, because now many XML applications are based on DTD.
Another alternative to DTD is the W3C definition of Schema,Schema, which can literally be translated into patterns, outlines, plans, plans, and so on. Its basic meaning is to develop a schema for XML documents.
The obvious advantage of Schema over DTD is that the XML Schema document itself is an XML document, rather than using its own syntax like DTD. This makes it convenient for users and developers because you can use the same tools to process XML Schema and other XML information without having to use special tools specifically for Schema. Schema is easy to understand, and anyone who knows the grammar and rules of XML can understand it immediately. The concept of Schema has been put forward for a long time, but the W3C standard has only come out recently, and the corresponding application support is not yet perfect, but the adoption of Schema has become a trend of XML development.
First, let's start with the simplest example to learn the grammatical structure of Schema:
For example, a simple XML document is as follows:
Moonlight Blade Gulong
If the structure of the XML document is defined in the form of DTD, it can be as follows:
So how do you define it in Schema form? See the following code:
< element name=' Book 'type=' Book Type' / > < complexType name=' Book Type'> < element name=' name 'type='string'/ > < element name=' author' type='string'/ > < / complexType >
It can be noted that in Schema, the definition of the nature and content of the entire document is also achieved through the definition of elements and the relationship between elements. At the same time, it should be noted that in Schema, the element is determined by its name and content model, and the name is the name of the element, which everyone can understand, while the content model is actually the type of the element. Just like in C++, we can define a variable freely, but we must define the type of the variable, so the type of the variable may have many forms, it can be a simple variable (such as the type specified internally by C++, bool,int,double,char, etc.), it can also be a very complex type (such as a struct or class), the same is true in Schema, type can be divided into two forms One is a very simple type, called simple, and the other is a complex type, called complex. Simple types cannot contain elements and attributes (note that in Schema, as in DTD, there is the same term for element attributes, the same avenue). Complex types can not only contain attributes, but can also nest other elements within them, or can be associated with attributes in other elements.
The above is all the content of the article "sample Analysis of Schema in XML". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.