Is this because of a typo between your xml "calendar" and the mapping file
"calender"


  _____  

From: Baba [mailto:[EMAIL PROTECTED] 
Sent: 26 May 2008 11:58
To: [email protected]
Subject: [castor-user] Order of the text



Hi Castor Community,

 

I'm looking for an idea for the following problem. I have to read and write
a XML File, which represent a text document. A basic problem of a text
document is the order of the text elements and the order of the text. The
first problem with the order of the text elements I found a solution which
works. But for the order of the text between the elements I'am searching for
a solution or an idea how to solve the problem. 
Here an example for the problem:
 

<text:p text:style-name="StVo_5f_Fett">

  <checkBox /> 

  <bookmark name="BM-1" /> 

  Your letter dated on 

  <calendar /> 

  handel Mr. / Mrs

  <bookmark text:name="BM-2" /> 

</text:p>

 

I marschal this XML with the following mapping file:

 

<class name="xml.objects.body.P">

      <map-to xml="text:p" />

      

      <field name="styleName" type="java.lang.String">

            <bind-xml name="text:style-name" node="attribute"/>

      </field>

            

      <field name="value" type="java.lang.String">

            <bind-xml node="text"/>

      </field>

            

      <field name="CheckBox" type="xml.objects.body.CheckBox" >

            <bind-xml name="checkBox" node="element"/>

      </field>

            

<field name="Bookmark" set-method="addBookmark" 
type="xml.objects.body.Bookmark" collection="arraylist">

            <bind-xml name="bookmark" node="element"/>

      </field>

            

<field name="Calender" set-method="addCalender" 
type="xml.objects.body.Calender" collection="arraylist">

            <bind-xml name="calender" node="element"/>

      </field>           

</class>

 

After the unmarschal of the object tree I get this XML:

 

<text:p text:style-name="StVo_5f_Fett">

  Your letter dated on  handel Mr. / Mrs

  <checkBox /> 

  <bookmark name="BM-1"/> 

  <calendar /> 

  <bookmark text:name="BM-2"/> 

</text:p>
 
Regards
Thomas

Reply via email to