Explain XML Schema
https://www.computersprofessor.com/2016/06/explain-xml-schema.html
There are two types of XML schemas.
®Internal schema
®External schema
XML
schema is an XML based altanative to DTD . An XML schema describe the structure of an XML document .XML schema is also referred to as ‘ XML
schema definition’ (XSD ).
The
purpose of XML schema is to define the
logical building blocks of an XML document
just Like a DTD.
XML schema:
® Defines elements that
can appear as in a document.
® Define attributes that can appear in
a document.
® Define which elements are child
elements.
® Define the no.of child elements.
® Define whether an element is empty
(or) can include text.
® Define data types for elements and
attributes.
® Define data types for elements and
attributes.
® Define default and fixed values for
elements and attributes.
XML
schema will be used in most web applications as a replacement for DTD’s.
1. XML schema’s are extensible to
future additions.
2. XML schema’s are richer and more
powerful than DTD
3. XML schema’s are written in XML.
4. XML schema’s support data type.
5. XML schema’s support name spaces
Eg:- < ? XML version = “ 1.0”?>
<XS : schema xmins : xs = “http://www.W3.org/xml schema>
<XS: element name ="note">
<XS: complex type>
<XS : sequence>
<XS: element name = “to” type = “xs: string"/>
<XS: element name = “from” type = “xs:string"/>
</XS: sequence>
</XS: complex type>
</XS: element>
</XS: schema>
