Hi,
I'm using XML-mappings from Hibernate 3 to directly get an xml-output out of a database-query. So no entity-classes in Java are needed.
But in my xml-mapping file I want to use custom xml-attributes such as
display-name="Customer Id:". So I tried to configure a XML-Schema instead of the following DTD-integration in my mapping-files:
Code:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
The schema out of the DTD has been automatically build by Oxygen and got expandet by another schema which defines custom attributes like
display-name.
All my schemas successfully validated and also the xml-mapping file successfully validated against the schemas which were implemented instead of the DTD-header in the mapping-file:
Code:
<hibernate-mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.hibernate.org/mapping"
xmlns:he="http://www.efkon.com/eva/schemaextension"
xsi:schemaLocation="http://www.hibernate.org/mapping file:///D:/Projects/EVA-App/Schema/eva/hibernate/hibernate-schema-3.0.xsd http://www.efkon.com/eva/schemaextension file:///D:/Projects/EVA-App/Schema/eva/hibernate/hibernate-schema-extension-3.0.xsd">
But when trying to deploy my application to Tomcat, the following error-message appeared in the console:
Quote:
Error parsing XML: XML InputStream(2) <Line 2, Column 19>: XML-0149: (Error) Element 'hibernate-mapping' used but not declared.
In my opinion, the Hibernate-build-in Xerces-parser can only validate against a DTD, but not against a schema.
So what can I do to solve this error without hacking the Hibernate-source to create a modified hibernate.jar file?
THX and best regards,
Thomas
Hibernate version: 3.1.2