cvc-elt.1: Cannot find the declaration of element 'student'.What to do?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 175518
    New Member
    • Nov 2012
    • 2

    cvc-elt.1: Cannot find the declaration of element 'student'.What to do?

    My xml document

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <student xmlns="hyperjam@mail/ru">
    <uek:copyright xmlns:uek="http://uek.krakow.pl/">Wydział Zarządzania, Uniwersytet Ekonomiczny, Krakуw</uek:copyright>
     <name gender="female">Anna</name>
     <surname>Postevka</surname>
     <age>18</age>
     <group faculty="applied informatic">KrDZIa1013</group>
     <country_of_origin>Ukraine</country_of_origin>
     <city>Rivne</city>
     <semester>1</semester>
     <listitem_books>
      <!-- This list of items describe the collection of fantasy,horror and fiction books, which where published in 2012. I choose this genres, because I like them the most and i wanted you to know,what's new in the world of this kind of books -->
       <book>
         <title genre="fiction">The White Forest</title>
    	 <original_title>Empyrean</original_title>
    	 <author gender="male">Adam McOmber</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="matte"></paper>
    	</book>
        <book>
         <title genre="fiction">Dodger</title>
    	 <original_title>The Dodger</original_title>
    	 <author gender="female">Terry Pratchett</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="glossy"></paper>
    	</book>
    	<book>
    	 <title genre="horror">Ten</title>
    	 <original_title>Ten</original_title>
    	 <author gender="female">Gretchen McNeil</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="matte"></paper>
    	</book>
    	<book>
    	 <title genre="fiction">Let the Right One In</title>
    	 <original_title>Lat den ratte komma in</original_title>
    	 <author gender="male">John Ajvide Lindqvist</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="matte"></paper>
    	</book>
    	<book>
    	 <title genre="fantasy">The Graveyard Book</title>
    	 <original_title>The Graveyard Book</original_title>
    	 <author gender="male">Neil Gaiman</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="glossy"></paper>
    	</book>
    	<book>
    	 <title genre="fantasy">Cursed</title>
    	 <original_title>Cursed</original_title>
    	 <author gender="female">Jennifer L. Armentrout</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="matte"></paper>
    	</book>
    	<book>
    	 <title genre="horror">The Necro Device</title>
    	 <original_title>Mandiev</original_title>
    	 <author gender="male">M.T. Dismuke</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="matte"></paper>
    	</book>
    	<book>
    	 <title genre="horror">The Hallowed Ones</title>
    	 <original_title>The Hallowed Ones</original_title>
    	 <author gender="female">Laura Bickle</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="glossy"></paper>
    	</book>
    	<book>
    	 <title genre="horror">Blackwood</title>
    	 <original_title>Blackwood</original_title>
    	 <author gender="female">Gwenda Bond</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="glossy"></paper>
    	</book>
    	<book>
    	 <title genre="horror">Incarnation</title>
    	 <original_title>Incarnation</original_title>
    	 <author gender="female">Emma Cornwall</author>
    	 <year_of_publishing>2012</year_of_publishing>
    	 <paper quality="matte"></paper>
    	</book>
      </listitem_books>
    </student>
    and here is my schema

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ru="hyperjam@mail/ru" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     
     
     <xsd:element name="student" type="StudentType"/>
      <xsd:complexType name="StudentType"> 
       <xsd:sequence>
        <xsd:element name="name">
    	 <xsd:complexType>
          <xsd:attribute name="gender" use="required">
    	   <xsd:simpleType>
    		<xsd:restriction base="xsd:string">
    		 <xsd:pattern value="male|female"/>
    		</xsd:restriction>	 
    	   </xsd:simpleType>
    	  </xsd:attribute>  
         </xsd:complexType>
        </xsd:element>
        <xsd:element name="surname" type="xsd:string" />
        <xsd:element name="age" type="xsd:integer" />
        <xsd:element name="group">
    	 <xsd:complexType>
          <xsd:attribute name="faculty" type="xsd:string" use="required"/>
         </xsd:complexType>
        </xsd:element>
        <xsd:element name="country_of_origin" type="xsd:string" />
        <xsd:element name="city" type="xsd:string" />
        <xsd:element name="semester" type="xsd:integer" />
        <xsd:element name="listitem_books">
         <xsd:complexType>
    	  <xsd:sequence>
           <xsd:element name="book" minOccurs ="10" maxOccurs="unbounded">
    		  <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="title">
    			   <xsd:complexType>
                     <xsd:simpleContent>
                      <xsd:extension base="xsd:string">
                       <xsd:attribute name="genre" use="required">
    				    <xsd:simpleType>
                         <xsd:restriction base="xsd:string">
                          <xsd:enumeration value="fantasy"/>
                          <xsd:enumeration value="horror"/>
    					  <xsd:enumeration value="fiction"/>
                        </xsd:restriction>
                       </xsd:simpleType>
                      </xsd:attribute>
    				 </xsd:extension>
                    </xsd:simpleContent>
                   </xsd:complexType>
                  </xsd:element>
    		      <xsd:element name="original_title" type="xsd:string" />
                  <xsd:element name="author">
    			   <xsd:complexType>
                     <xsd:simpleContent>
                      <xsd:extension base="xsd:string">
                       <xsd:attribute type="xsd:string" name="gender" use="required"/>
    				 </xsd:extension>
                    </xsd:simpleContent>
                   </xsd:complexType>
                  </xsd:element>
                  <xsd:element name="year_of_publishing" type="xsd:integer" />
                  <xsd:element name="paper">
    			   <xsd:complexType>
                    <xsd:simpleContent>
                     <xsd:extension base="xsd:string">
                      <xsd:attribute name="quality" use="required">
    				   <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                         <xsd:enumeration value="glossy"/>
                         <xsd:enumeration value="matte"/>
                        </xsd:restriction>
                       </xsd:simpleType>
                      </xsd:attribute>
                     </xsd:extension>
                    </xsd:simpleContent>
                   </xsd:complexType>
    			  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
    	   </xsd:element>
          </xsd:sequence>
         </xsd:complexType>
        </xsd:element>
       </xsd:sequence>
      </xsd:complexType> 
    </xsd:schema>
    the validator says

    Not valid.
    Error - Line 2, 35: org.xml.sax.SAX ParseException; lineNumber: 2; columnNumber: 35; cvc-elt.1: Cannot find the declaration of element 'student'.
    Last edited by Rabbit; Nov 4 '12, 10:12 PM. Reason: Please use code tags when posting code.
Working...