May 28, 2021 XML Schema
Since XML Schemas does the same thing as DTD (document type definition), why use XML Schemas?
XML Schema is more powerful than DTD.
One of XML Schema's most important capabilities is support for data types.
Editor's note: Data constraints, or facets, are a term in the XML Schema prototype that can be translated as a Chinese face" to constrain the permissible values of the data type.
Another important feature about XML Schema is that they are written by XML.
When data is sent from the sender to the recipient, the point is that both parties should have the same "expectations" for the content.
With XML Schema, the sender can describe the data in a way that the recipient can understand.
One data, such as "03-11-2004", was interpreted in some countries as 3 November and in others as 11 March.
However, an XML element with a data type, such as: .lt;date type="date";2004-03-11</date=gt;, ensures a consistent understanding of the content because the data type "date" of the XML requires a format of "YYYYY-MM-DD".
XML Schema is scalable because they are written by XML.
We refer to documents that conform to the XML syntax as well-formed XML documents, such as:
Even if the documents are in good form, there is no guarantee that they will not contain errors, and that these errors can have serious consequences.
Consider the following scenario: You ordered 5 laser printers instead of 5. With XML Schema, most of these errors are caught by your validation software.
In the next section, we'll start learning to use XML Schema.