Computer Science

Xml -Xml Schema

XML (Extensible Markup Language) is a markup language used to express data in a structured way. Example:

                        <book>
  <title>Book Name</title>
  <author>Author</author>
  <price>100</price>
</book>
                    

Xml Schema

An XML Schema (often referred to as an .xsd file) is a schema that defines the structure, content, and rules of XML documents. It is used to verify that XML data is in the correct format (validation).

Xml Schema Example


• title: string
• author: string
• price: decimal

                        <?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="kitap">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="title" type="xs:string" />
        <xs:element name="author" type="xs:string" />
        <xs:element name="price" type="xs:decimal" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
                    

Result

XML is a text file that carries data. XML Schema determines the structure and validity rules of that data.