We shall take another look at “elementFormDefault” and “attributeFormDefault” later. The above states that we are about to start our own schema design, which conforms to the rules and regulations available at http://www.w3.org/2001/XMLSchema (in fact it is an “XML namespace”). “xs” is the preferred prefix, which is mainly used to point to that “namespace” for declarations, definitions or several available structures.
Let us now design a somewhat realistic example. The following XML Schema defines an element, “Organization,” to be used in our markup.
Note that I saved the above in a file named “Sample1.xsd” (every XML Schema is generally stored with an extension “xsd”). Within the above schema, “Organization” is the element name and “string” is its data type. The following are the quite common data types used in defining XML Schemas:
Now, let us see the XML document which conforms to the above defined schema.
Now, you can observe that you started with your own “Organization” element, which is exactly what you defined in the schema above. You should also observe that I included my XSD document (schema), to follow my schema rules and regulations for proper validation.