Reputation: 31
I am new to hibernate and i am using it with java. I have made hibernate mapping file for my Entity and tested it on local machine and it worked fine. However when I was running on server I got error as "InvalidMappingException"
But after putting following tag:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
it got solved.
What was problem which got resolved after putting this <!DOCTYPE...>
tag in hbm file ?
Upvotes: 0
Views: 1638
Reputation: 2294
The <!DOCTYPE...>
attribute is the first line of any xml file. It basically gives the structure of an XML file and how that particular XML can be parsed. Any XML file without a <!DOCTYPE...>
will not compile as the structure becomes undefined. Check this for references:
http://www.w3schools.com/dtd/dtd_intro.asp
What is the meaning of DOCTYPE in xml file?
Upvotes: 0
Reputation: 122006
The DocType attribute not only belongs to hibernate mapping file.
Its common for all files like html ,css,js ,xml..etc
The XML document type declaration contains or points to markup declarations that provide a grammar for a class of documents. This grammar is known as a document type definition, or DTD
http://www.w3.org/TR/xml/#dt-doctype
Upvotes: 1