-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to include a XML-Schema instead of a DTD in XML-mapping
PostPosted: Mon Mar 06, 2006 6:08 am 
Newbie

Joined: Fri Mar 03, 2006 8:52 am
Posts: 5
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.