• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Castor Marshalling Problem

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am Using CASTOR to Marshal into an XML document and the Object(s),
information is not getting Marshalled in the Same Order which I set.
So, Is there any mechanism/way to SPECIFY/RESTRICT the ORDER OF CASTOR XML MARSHALLING.

Please, Suggest.

Thanks.
 
Ranch Hand
Posts: 188
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you been using a mapping file ?

Can you explain in a little more detail what you are trying ?
 
b panigrahy
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been using MAPPING File. But, My Problem is, the Order of XML Tags in Source XML is not proper/aligned with the Marshalled XML.

For e.g.,

SOURCE XML:
----------------
<root>
<group>
<A1>c</A1>
<B1>d</B1>
</group>

<eg>abc</eg>
<ad>cdef</ad>
</root>

My mapping file also contains the same order as above and it's appropriate Java objects. Say, "Root.java" is the Main Java Object, wich consists of all the tags/child tags data and When, I MARSHAL this Java Object back to XML, the tags ORDER is disturbed/not aligned with the SOURCE.XML

OUTPUT.XML
---------------
<root>
<group>
<A1>c</A1>
<B1>d</B1>
</group>

<eg>abc</eg>
<ad>cdef</ad>
</root>

In above, the <group> tag came at the end of XML instead of at beginng.
But, Ofcourse, I am not losing any data of source xml.

I hope, I am clear.

Thanks.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic