Resource Files (sc-valid.xml, sc-notValid.xml, and sc.xsd)

 

The resource files shown in this topic are for use with the following examples:

XML Data File (sc-valid.xml)

<?xml version="1.0"?>
<x:catalog xmlns:x="urn:books">
   <book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
   </book>
</x:catalog>

XML Data File (sc-notValid.xml)

<?xml version="1.0"?>
<x:catalog xmlns:x="urn:books">
   <book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <cost>44.95</cost>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
   </book>
</x:catalog>

XSD Schema File (sc.xsd)

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="urn:books" 
            xmlns:b="urn:books">
  <xsd:element name="catalog" type="b:CatalogData"/>
    <xsd:complexType name="CatalogData">
      <xsd:sequence>
        <xsd:element name="book" 
                     type="b:bookdata"
                     minOccurs="0" 
                     maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="bookdata">
      <xsd:sequence>
        <xsd:element name="author" type="xsd:string"/>
        <xsd:element name="title" type="xsd:string"/>
        <xsd:element name="genre" type="xsd:string"/>
        <xsd:element name="price" type="xsd:float"/>
        <xsd:element name="publish_date" type="xsd:date"/>
        <xsd:element name="description" type="xsd:string"/>
      </xsd:sequence>
      <xsd:attribute name="id" type="xsd:string"/>
    </xsd:complexType>
</xsd:schema>