Simple XSD Types
- XML schemas define the different types of elements that can be used in XML documents. There are a lot of XML simple elements, but a select few are common throughout almost all XML documents. Once you know which elements are linked with the XML simple schemas, you will be able to use the basic elements in similar ways as stylesheets within HTML.
- The xs:string schema is used for basic text information such as names, places or titles. In the XML section of the document you could type, as an example: <xs:element name="placename" type="xs:string" />. Then you would use the <placename> and </placename> tags to enclose a basic text string for that characteristic.
- The xs:integer schema is used for basic number information, excluding dates. If you wanted to enter the quantity, age or volume of something, use the integer schema. In the XML section of code you would use, in the example of quantity:
<xs:element name="quantity" type="xs:integer" />, then use the <quantity> and </quantity> tags to signify the numerical information in a quantity characteristic. - The xs:date and xs:time schemas are used to designate dates and times in XML coding. You would enter these codes into the XML headers: <xs:element name="date" type="xs:date" /> and <xs:element name="time" type="xs:time" />. As with the other XML tags you'd use the element's name to enter the information. The <date> and <time> tags would be used respectively.