"Somalingam, Dinesh BGI UK" wrote:
> 
> My mapping.xml has the following :
> 
>     <class name="com.bglobal.delta.data.Plan">
>         <field name="id" type="java.lang.String">
>             <bind-xml name="obj_id" node="attribute" QName-prefix="dctm"/>
>         </field>

QName-prefix is used only for QName types. It's not used for namespace
mapping.


>         .
>         .
>         .
> Marshalling the Plan bean (not generated using source generator)  using
> Marshal.setNamespaceMapping("dctm", "my uri") I get
>         <plan obj_id="90890898978" xmlns:dctm="my uri">
> 
> But what I really want as output is
>         <plan dctm:obj_id="90890898978" xmlns:dctm="my uri">
> 
> Is it possible for me to get the above output ? - other than using regexp on
> my first output :)

Try one of the following approaches:

1. add a map-to element to the class mapping as such:

     <class name="com.bglobal.delta.data.Plan">
         <map-to ns-uri="my uri"/>                      <--- new
         <field name="id" type="java.lang.String">
             <bind-xml name="obj_id" node="attribute"/>  <--- changes
         </field>

-or-

2. declare the namespace and use a QName for attribute name as such:

     <class name="com.bglobal.delta.data.Plan" xmlns:dctm="my uri">   <-
changes
         <field name="id" type="java.lang.String">
             <bind-xml name="dctm:obj_id" node="attribute"/>  <--
changes
         </field>


--Keith

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

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

Reply via email to