title: Error parsing XML in Hibernate
body: <p>I am getting error in my XML parsing in Hibernate</p>
  
  <p>The mapping file is,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;!DOCTYPE hibernate-mapping PUBLIC 
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-mapping&gt;
  &lt;class name="Student" table="student" schema="db_1"&gt;
          &lt;id name="id" column="id" type="int"&gt;
              &lt;generator class="assigned"/&gt;
          &lt;/id&gt;
          &lt;property name="name" column="name" type="string"/&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>The config file is,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
    &lt;session-factory&gt;
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/db_1&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;root&lt;/property&gt;
      &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
      &lt;mapping resource="Student.hbm.xml"/&gt;
      &lt;mapping resource="hibernate.hbm.xml"/&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I am getting the below error while running the code-</p>
  
  <pre><code> 234 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource :     Student.hbm.xml
  
  265 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (5) : Element type "hibernate-mapping" must be declared.
  
  265 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (6) : Element type "class" must be declared.
  
  265 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (7) : Element type "id" must be declared.
  
  265 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (8) : Element type "generator" must be declared.
  
  265 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (10) : Attribute "column" must be declared for element type "property".
  
  265 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (10) : Attribute "type" must be declared for element type "property".
  
  265 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (2) : Element type "hibernate-mapping" must be declared.
  
  265 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (3) : Element type "class" must be declared.
  
  281 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (4) : Element type "id" must be declared.
  
  281 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (5) : Element type "generator" must be declared.
  
  281 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (7) : Attribute "column" must be declared for element type "property".
  
  281 [main] ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (7) : Attribute "type" must be declared for element type "property".
  
  Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Unable to read XML
  </code></pre>
  
  <p>Could anyone help me and highlight the issues, eventhough I have validated the XML.</p>