What is the difference between XML and XSD?

后端 未结 7 958
南笙
南笙 2020-11-27 11:31

What is the difference between Extensible Markup Language (XML) and XML Schema (XSD)?

7条回答
  •  暖寄归人
    2020-11-27 11:57

    XSD:
    XSD (XML Schema Definition) specifies how to formally describe the elements in an Extensible Markup Language (XML) document.
    Xml:
    XML was designed to describe data.It is independent from software as well as hardware.
    It enhances the following things.
    -Data sharing.
    -Platform independent.
    -Increasing the availability of Data.

    Differences:

    1. XSD is based and written on XML.

    2. XSD defines elements and structures that can appear in the document, while XML does not.

    3. XSD ensures that the data is properly interpreted, while XML does not.

    4. An XSD document is validated as XML, but the opposite may not always be true.

    5. XSD is better at catching errors than XML.

    An XSD defines elements that can be used in the documents, relating to the actual data with which it is to be encoded.
    for eg:
    A date that is expressed as 1/12/2010 can either mean January 12 or December 1st. Declaring a date data type in an XSD document, ensures that it follows the format dictated by XSD.

提交回复
热议问题