XML Schemas

XML schemas are text-based documents written in the XML schema language that describe the structure of your XML document(s). An XML schema is, in effect, the definition of your language. In order for other people to use your language in their application they need the definitions described in the schema. Other applications need this definition in order to understand the elements' meaning in your XML document; otherwise, the language cannot be understood except by your own applications—because, of course, you know the meaning of your own language. The following schema defines the elements of the XML document that describes a test for the Math Game program.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element nillable="true" name="test"> <xsd:complexType>

<xsd:sequence min0ccurs="0">

<xsd:element min0ccurs="0" max0ccurs="unbounded" nillable="true" name="problem" form="unqualified"> <xsd:complexType>

<xsd:sequence min0ccurs="0">

<xsd:element min0ccurs="0" nillable="true" type="xsd:integer" name="number" form="unqualified">

</xsd:element>

<xsd:element min0ccurs="0" nillable="true" type="xsd:integer" name="left_operand" form="unqualified">

</xsd:element>

<xsd:element min0ccurs="0" nillable="true" type="xsd:string" name="operator" form="unqualified">

</xsd:element>

<xsd:element min0ccurs="0" nillable="true" type="xsd:integer" name="right_operand" form="unqualified">

</xsd:element>

<xsd:element min0ccurs="0" nillable="true" type="xsd:integer" name="answer" form="unqualified">

</xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

If you glance through this code, you may recognize that it's defining data types and properties for the elements in the XML document describing a test. Unfortunately, learning how to write XML schemas is beyond the scope of this book; however, at this point, it really doesn't matter because Excel will generate schemas for you if you don't define them yourself. In the Math Game program, you will never have to work with a schema even though they are present and working in the background.

Biorhythm Awareness

Biorhythm Awareness

Who else wants to take advantage of biorhythm awareness to avoid premature death, escape life threatening diseases, eliminate most of your life altering mistakes and banish catastrophic events from your life.

Get My Free Ebook


Post a comment