I've posted a question on Stackoverflow ( http://stackoverflow.com/questions/593995/jibx-how-to-map-a-class-and-avoid-it-being-outputed-as-xml-node ). Here's the transcript:

I am using [JibX][1] as a Java Object to XML Binding tool.

With it, I want to have the following output:

    <?xml version="1.0" encoding="UTF-8"?>
    <FEAPService>
     <Request>
      <Function>aaa</Function>
      <SubFunction>bbb</SubFunction>
      <Operation>ccc</Operation>
     </Request>
    </FEAPService>

But I'm getting this:

    <?xml version="1.0" encoding="UTF-8"?>
    <FEAPService>
     <Request>
      <baseForm> <!-- I DO NOT WANT THIS baseForm TAG -->
       <Function>aaa</Function>
       <SubFunction>bbb</SubFunction>
       <Operation>ccc</Operation>
      </baseForm>
     </Request>
    </FEAPService>

Here's the JibX binding file:

    <binding name="requestBinding_com_struts_form_SpecificForm">
     <mapping name="baseForm" class="com.struts.form.BaseForm">
      <value name="Function" field="function" />
      <value name="SubFunction" field="subFunction" />
      <value name="Operation" field="operation" />
     </mapping>   
     <mapping name="FEAPService" class="com.struts.form.SpecificForm"
      extends="com.struts.form.BaseForm">
      <structure name="Request">
          <structure map-as="com.struts.form.BaseForm" />
      </structure>
     </mapping>
    </binding>


I guess it might be achieved by implementing my own Marshaller, but I'm not sure if that's the easiest way.

  [1]: http://jibx.sourceforge.net

 

 



Lucas Noleto De Arruda
Tata Consultancy Services
Mailto: lucasnoletode.arr...@tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to