7.1. A Simple XML Schema Document Example

Listing 7.1 is a trivial XML schema document that specifies only an element type whose structure type is the built-in string datatype.

Listing 7.1. A Trivial XML Schema Document (simpleSchema.xsd)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <xsd:element name="stringElement" type="xsd:string"/> 
</xsd:schema> 

A few features to point out about the preceding trivial schema:

  • The only attribute of the schema element—xmlns:xsd—specifies the namespace http://www.w3.org/2001/XMLSchema. Furthermore, the xmlns:xsd attribute specifies the corresponding namespace prefix, ‘xsd’. The specification of the XML schema namespace implies a corresponding XML schema document XMLSchema.xsd, which is the Schema ...

Get XML Schema Complete Reference, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.