15.2.3. Why use XML Schemas?

发布时间 :2025-10-25 12:23:26 UTC      

XML Schema is more powerful than DTD.

XML Schema supports data types

One of the most important capabilities of XML Schema is its support for data types.

Through support for data types:

  • It is easier to describe the allowed document content.

  • It is easier to verify the correctness of the data.

  • Makes it easier to work with data from the database

  • Data constraints can be more easily defined (data facets)

  • It is easier to define a data model (or data format)

  • It is easier to convert data between different data types

Editor’s note: data constraint, or facets, is a term in the XML Schema prototype, which can be translated as “face” in Chinese and is used to constrain the allowable values of data types.

XML Schema uses XML syntax

Another important feature about XML Schema is that they are written by XML.

There are many benefits to writing XML Schema by XML:

  • There is no need to learn a new language

  • You can use the XML editor to edit Schema files

  • You can use the XML parser to parse Schema files

  • Schema can be handled through XML DOM

  • Schema can be converted through XSLT

XML Schema protects data communication

When data is sent from the sender to the receiver, the point is that both parties should have the same “expected value” about the content.

With XML Schema, the sender can describe the data in a way that the recipient can understand.

One kind of data, such as “03-11-2004”, is interpreted as November 3 in some countries and March 11 in others.

But a XML element with a data type, such as < date type= “date” > 2004-03-11 < / date >, ensures a consistent understanding of the content, because the format required by XML’s data type “date” is “YYYY-MM-DD”.

XML Schema Extensible

XML Schema are extensible because they are written by XML.

With extensible Schema definitions, you can:

  • Reuse your Schema in other Schema

  • Create your own data types derived from standard types

  • Reference multiple Schema in the same document

Good form is not enough.

We refer to documents that conform to XML syntax as well-formed XML documents, such as:

  • It must start with a XML declaration

  • It must have a unique root element.

  • The start tag must match the end tag

  • Elements are case sensitive

  • All elements must be closed

  • All elements must be nested correctly

  • Entities must be used for special characters

Even if the documents are well formed, there is no guarantee that they will not contain errors, and these errors can have serious consequences.

Please consider the following situation: you ordered 5 dozen laser printers instead of 5. With XML Schema, most of these errors will be caught by your validation software.

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.