What is XML Schema Element

This article teach you about XML Schema Element in XML
  • 2133

Schema element

It is the base element or root element of every XML Schema document. And it is contain some Attributes constraint element within Schema opening and closing tag.

Example:

<?xml version="1.0" encoding="utf-8"?>

<xs:schema>

……….

……….

……..

</xs:schema>

 

Note: Above declared code is the example of XML Schema. Which define the Schema Element.

Schema Attributes

Schema element contain also some Attributes, Within the Schema opening tag Example

 

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.dotnetheaven.com"
xmlns="http://www.dotnetheaven.com"
elementFormDefault="qualified">
...
...
</xs:schema>

But in above declared XML Schema the part

mlns:xs="http://www.w3.org/2001/XMLSchema"

 

Show that the elements and it's data types used in the XML schema come from the "http://www.w3.org/2001/XMLSchema" namespace. And it is also indicate that before the xmlns:xs=http://www.w3.org/2001/XMLSachem used XS:

 

This part of XML schema

 

targetNamespace="http://www.dotnetheaven.com"

 

Show that element declared in this schema ( note , to, from, heading, body.) come from the
"http://www.dotnetheaven.com" namespace

 

This part of XML schema

 

xmlns="http://www.dotnetheaven.com"

 

Show that default Namespace is "http://www.dotnetheaven.com"

This part of XML schema

 

elementFormDefault="qualified


Show that any element used in the XML document must be declared in the namespace qualified

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

© 2019 DotNetHeaven. All rights reserved.