that was ist thank. But: isn't that nuts? I wasn't aware that the order of elements in an xml-file has anything to do with its corectness.
regards Tino
Armin Waibel wrote:
Hi Tino,
(I'm not an xml-expert ;-) ) try to keep the order of elements declared in repository.dtd
<!ELEMENT class-descriptor ((documentation?, extent-class+, attribute*) | (documentation?, object-cache?, extent-class*, field-descriptor+, reference-descriptor*, collection-descriptor*, index-descriptor*, attribute*, insert-procedure?, update-procedure?, delete-procedure?))>
First all reference-descriptor, then all collection-descriptor ....
regards, Armin
Tino Schöllhorn wrote:
Hi,
I want to ensure that the repository.xml-file is "syntactically" (is that english) correct. So I am trying to validate it against its dtd with the following code:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new ErrorHandler() { // some error handling code here }); Document doc = builder.parse(new File(repositoryFile));
Whenever I start this with my repositoy.xml file I get the following messages:
ERROR: 30:-1 :org.xml.sax.SAXParseException: In Element "class-descriptor" ist hier "reference-descriptor" nicht zulässig.
[ojb-generator] ERROR: 40:-1 :org.xml.sax.SAXParseException: In Element "class-descriptor" ist hier "reference-descriptor" nicht zulässig.
So it seems that there is an error in my xml-file: but it works fine and the repository.dtd says that "referecne-descriptor" should be a valid element.
Nontheless the application is running fine with my repository.xml-file - so I don't think there is an error. For those who are interested I attach the repository_user.xml file.
What am I missing ?
Thanks for any help. Tino
------------------------------------------------------------------------
<class-descriptor class="kos.om.Person" table="Person"> <field-descriptor name="id" column="PE_ID" jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
<field-descriptor name="name" column="PE_NAME" jdbc-type="VARCHAR"/>
<field-descriptor name="description" column="PE_Beschreibung" jdbc-type="LONGVARCHAR"/>
<field-descriptor name="surname" column="PE_SURNAME" jdbc-type="VARCHAR"/>
<field-descriptor name="birthPlaceId" column="PE_Geburtsort" jdbc-type="INTEGER" access="anonymous"/>
<field-descriptor name="creationDate" column="PE_ErstDatum" jdbc-type="TIMESTAMP"/>
<field-descriptor name="birthDay" column="PE_Geburtstag" jdbc-type="DATE"/>
<field-descriptor name="deleted" column="PE_geloescht" jdbc-type="BIT"/>
<field-descriptor name="fatherId" column="PE_Vater" jdbc-type="INTEGER" access="anonymous"/>
<!-- N:M - Relation -->
<collection-descriptor
name="departments"
element-class-ref="kos.om.Department"
auto-retrieve="true"
auto-update="true"
auto-delete="false"
proxy="true"
indirection-table="Department_Person">
<fk-pointing-to-this-class column="DEPE_Person"/>
<fk-pointing-to-element-class column="DEPE_Department"/>
<attribute attribute-name="reverseCollection" attribute-value="persons"/>
</collection-descriptor>
<!-- 1: N - Relation: 1er Seite -->
<reference-descriptor name="birthPlace" class-ref="kos.om.City"
auto-retrieve="true"
auto-update="true">
<foreignkey field-ref="birthPlaceId"/>
<attribute attribute-name="reverseCollection" attribute-value="bornPeoples"/>
</reference-descriptor> <reference-descriptor name="father" class-ref="kos.om.Person"
auto-retrieve="true"
auto-update="true">
<foreignkey field-ref="fatherId"/>
</reference-descriptor>
<collection-descriptor name="children" element-class-ref="kos.om.Person"
auto-retrieve="true"
auto-update="true"
proxy="true">
<inverse-foreignkey field-ref="fatherId"/>
</collection-descriptor> </class-descriptor>
<class-descriptor class="kos.om.Department" table="Department">
<field-descriptor name="id" column="DE_ID" jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
<field-descriptor name="name" column="DE_NAME" jdbc-type="VARCHAR"/>
<collection-descriptor
name="persons"
elemgent-class-ref="kos.om.Person"
auto-retrieve="true"
auto-update="false"
indirection-table="Department_Person">
<fk-pointing-to-this-class column="DEPE_Department"/>
<fk-pointing-to-element-class column="DEPE_Person"/>
<attribute attribute-name="reverseCollection" attribute-value="departments"/>
</collection-descriptor>
<collection-descriptor
name="subDepartments"
element-class-ref="kos.om.Department"
auto-retrieve="true"
auto-update="false"
indirection-table="Department_Department">
<fk-pointing-to-this-class column="DEDE_Master"/>
<fk-pointing-to-element-class column="DEDE_Detail"/>
<attribute attribute-name="reverseCollection" attribute-value="parentDepartments"/>
</collection-descriptor>
<collection-descriptor
name="parentDepartments"
element-class-ref="kos.om.Department"
auto-retrieve="true"
auto-update="false"
indirection-table="Department_Department">
<fk-pointing-to-this-class column="DEDE_Detail"/>
<fk-pointing-to-element-class column="DEDE_Master"/>
<attribute attribute-name="reverseCollection" attribute-value="subDepartments"/>
</collection-descriptor>
</class-descriptor>
<class-descriptor class="kos.om.City" table="City">
<field-descriptor name="id" column="CI_ID" jdbc-type="INTEGER" primarykey="true" autoincrement="true"/>
<field-descriptor name="name" column="CI_Name" jdbc-type="VARCHAR"/>
<collection-descriptor name="bornPeoples" element-class-ref="kos.om.Person">
<inverse-foreignkey field-ref="birthPlaceId"/>
<attribute attribute-name="reverseReference" attribute-value="birthPlace"/>
</collection-descriptor>
</class-descriptor>
------------------------------------------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]