Simply put: XML Schema is a class of XML, which is also equivalent to the table structure pattern of relational tables. Most of the time it is possible for a program to automatically generate its XSD based on an existing XML, or to generate its corresponding XSD based on relational tables (actually converting relational data into XML data, which is how the typed dataset in Vs2005 is implemented).
It is also useful to do some simple understanding of XML schemas.
XML Schema is used to describe the file structure of an XML document. XML Schemas are sometimes referred to as XML Schema Definition, so they are also called XSD. The schema file is therefore a suffix of XSD.
Defining the structure of an XML document means:
Defines the element that can appear in the document. Defines the attributes that can appear in a document. Defines which element is a child element. Defines the order of the element. Defines the number of child elements. Defines whether an element can be empty, and whether it can contain text. Define data types for each element and attribute. Define default values and fixed values for element and attribute. Because of the above definitions, we can use XML more clearly to describe what we want to express. Make it easier for the recipient of the XML to understand what the content means.
There are several steps to validating an XML document:
1. Defining an XML Schema or Dtd:schema or DTD defines structural criteria for all documents of the same type, such as documents about book information that can share a standard.
2. To apply a schema or DTD: A schema is typically specified by the author of the document, so that the recipient can quickly validate the document against the instructions. However, in the C/s (client/server) environment, because the server is unable to determine whether the XML has been validated at the client, in order to be able to ensure the verification process, and to avoid possible duplicate verification, the operation of the document application schema or DTD is done by the server.
3. Run the parser to verify that the parser scans the structure while loading the document, and that any errors will terminate the load process.
and make an appropriate response.