Thanks all for your help..

I'm a beginner with Castor (and with english language too....)  :-)

Now, its working  ! 

Best regards


----- Original Message ----- 
From: "Sudhendra Seshachala" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 17, 2004 3:32 PM
Subject: Re: [castor-user] [XML] Marshall attribute


> Basically
>  You need another field to map to the value part in the xml.
> This is just to give an idea. Just tweak the mapping I sent..
> 
> 
> -----Original Message-----
> From: Sudhendra Seshachala [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 17, 2004 11:26 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-user] [XML] Marshall attribute
> 
> Check the mapping as below..
> <class name="A">
>                           <field name="url" type="B" />             
> 
>                   </class> 
>                    
>                   <class name="B>
>                           <field name="fixedAtt" type="string">
>                              <bind-xml name="att" node="attribute"/>
>                           </field>
>                           <field name="value" type="string">
>                              <bind-xml name="att" node="text"/>
>                           </field>
>                    <class>
> -----Original Message-----
> From: Cristian [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 17, 2004 11:19 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-user] [XML] Marshall attribute
> 
> 
> Hi all
> 
> I have a simple question, I think: 
> 
>        I want to marshall an xml file with this format:
> 
> 
>            <root>   
>                 <url att="aaa">bbb</url>
>             </root>
> 
>       The attribute value (aaa) is fixed.
>   
>        I have two classes:
> 
>                 public class A {
>                      public B url= new B();
> 
>                      public B getUrl() {return url}
>                      public void setUrl(B b) { url = b; }
>                       
>                     }
> 
>                  public class B {
>                       public String url = "";
>                       public String fixedAtt = "aaa";
>                   }
>       
>           And my mapping file look like this:
>                  <class name="A">
>                           <field name="url" type="B" />             
> 
>                   </class> 
>                    
>                   <class name="B>
>                           <field name="fixedAtt" type="string">
>                              <bind-xml name="att" node="attribute"/>
>                           </field>
>                    <class>
> 
> 
>           When I execute my code, the result look like:
>        
>                    <url att="aaa" />
> 
>           but I want something like:
>                  <url att="aaa">Something</url>
> 
>           It's that possible ?
> 
>           Thanks..
> 
> 
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user
> 
> 



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to