Hi all,

I have a situation where my application may receive XML attributes with underscored names:

<CONTAINER KEY="1"><ERROR _MSGNO="1002" _MSGTEXT="Message Text" /></CONTAINER>

My Java objects are CONTAINER and ERROR, and although the error object is correctly set on the container, the attributed of the error object are always null.

However if I modify the XML and remove the underscore from the attribute names both are set correctly.

I have names my variables in the ERROR class variants of _MSGNO and MSGNO with no effect. I have also tried to manually map the fields like this:

<mapping>
  <class name="my.package.ERROR">
    <map-to xml="ERROR" />

    <field name="MSGTEXT" type="java.lang.String">
      <bind-xml name="_MSGTEXT" node="attribute"/>
    </field>

   <field name="MSGNO" type="java.lang.String">
      <bind-xml name="_MSGNO" node="attribute"/>
   </field>
  </class>
</mapping

Am I missing something?

Kind Regards,

Dan


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to