Manually write an instance of an XML Schema (XSD)

Source: Internet
Author: User
Tags define

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.