Why we use Schema in XML

This article article describe about XML Schema in XML
  • 2512

Why we used XML Schemas?

One of the most important reasons behind the using of XML Schema is that XML Schema sport data type.

Some point are given about this

  • It can be describe very easy to Xml document
  • It checks validation very easily
  • It is easily works on the database
  • It is easily define constraint (restrictions on data)
  • It is easily describe that how data is used (data formats)
  • It is easily convert data between different data types

XML Schemas use XML Syntax

Second benefit about XML Schema that it is written in XML language .

The strength of XML Schema is

       • We don't need to learn another new language
       • We can use XML editor for editing the XML Schema
       • We can use your XML parser to parse our Schema files
       • We can manipulate our Schema with the XML DOM
       • We can modify our Schema with XSLT

XML Schemas Secure Data Communication

When we send data from a sender to a receiver, it is important that both parts have the same "data send and receive expectations" about the content.
In XML Schema sender describe the data in similar manner which can receiver easily understand.

For Example: Date is written like "10/05/2012". But this type of date spoken in some countries 10th May .Whereas in some countries 5 October. So people of different countries can be confuse but XML Schema solves this type of problem.

XML Schemas are Extensible

XML Schemas are extensible language, because we can extend this in future. And it also written in XML.

With an extensible Schema we can:

    • We can reuse Schema in other Schema
    • We can Create our own data types derived from the standard types
    • We can add Reference multiple schemas in the single document  

Well-Formed

Well-Formed means XML document must follow the predefine XML rule and regulatio

For example:

     • it must be start with the XML declaration
     • it is necessary to declare a unique root tag
     • Elements of XML are case and space sensitive
     • If any element tag start then must be closed
     • all attribute values must be within double quoted
     • entities are special character or keyword

Even if documents are well-formed they can still contain errors, and those errors can have serious consequences.

Think of the following situation: you order 5 gross of laser printers, instead of 5 laser printers. With XML Schemas, most of these errors can be caught by your validating software.

Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.