Hi, I implemented the solution from Ralf and it works ;)
Which kind of XML schema is supported by castor? Only the xsd- schema? thanks. Thomas On Mon, Apr 14, 2008 at 9:20 PM, Werner Guttmann <[EMAIL PROTECTED]> wrote: > There is one more alternative. If you wrote an XML schema that defined a > valid grammar for your XML (which would have to use a choice, I assume), > you'd be able to preserve order easily. > > Werner > > > > Ralf Joachim wrote: > > Hi Thomas, > > > > if you work with 2 collections you will always get what you see at the > > moment. The only solution for your problem is to use only one > > collection. Castor then will marshal the objects in the sequence they > > are contained in the collection. Maybe you create a wrapper collection > > that lets your 2 collections look like one for marshaling. > > > > Regards > > Ralf > > > > > > Thomas Schoofs schrieb: > > > > > Hi Castor- Community, > > > > > > it' is possible to say Castor use for the output- file the same order > > > of elements as the order of the elements at the input- file is? > > > > > > I have the following input-file > > > > > > <xml....> > > > <PropertyItem /> > > > <FunnyItem /> > > > <PropertyItem /> > > > <FunnyItem /> > > > <PropertyItem /> > > > <FunnyItem /> > > > </xml> > > > > > > The number of the items is not defined and the order is very imported. > > > In my Java Object I define two collections one for the FunnyItems and > > > another for the PropertyItems. To map the xml- file to java- objects I > > > use the castor- mapping file option. > > > If I marshall this objects I get the following order of the Objects: > > > > > > <xml....> > > > <PropertyItem /> > > > <PropertyItem /> > > > <PropertyItem /> > > > <FunnyItem /> > > > <FunnyItem /> > > > <FunnyItem /> > > > </xml> > > > > > > I believe the reason why Castor orders the items in this way I had > > > figured out. But I like to know how I can change this behavior? > > > > > > Greetings > > > Thomas > > > > > > --------------------------------------------------------------------- > > > 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