The sequence could be different each time - the xml document describes a gui
, and the order in which the elements appear in the file determines the tab
order in the legacy system, hence the requirement to marshall objects in a
particular sequence.
So, in one file, the order may need to be label, button, field, field, but
in another it could be field, button, field, button, and so on.
Is there any solution to this? Or do I need to abandon Castor - which would
be a shame.
Werner Guttmann writes:
How about trying to match the sequence of your field mappings in the
mapping file to the expected sequence ? If you use a mapping file,
Castor simply marshalls fields as encountered in the mapping file.
Werner
[EMAIL PROTECTED] wrote:
Can Castor preserve the sequence of elements it unmarshalls when it goes
to marshall things back up?
Example:
XML going in..
<window>
<button> Button1 </button>
<label> Label1 </label>
<button> Button2 </button>
</window>
XML going out
<window>
<button> Button1 </button>
<button> Button2 </button>
<label> Label1 </label>
</window>
When being marshalled back up, Castor will group all the buttons
together, labels, etc. in the order as defined by the mapping file.
However, for reasons that are beyond my control, I need to be able to
write out the XML file in the same order that I read it in. I tried
putting all elements in a single vector, but I get an error complaining
of multiple instances of the same field in the mapping file.
Any suggestions?
Thank you,
Justin
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email