commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: [betwixt] bug: output is in reverse order of input...
Date Thu, 13 Jun 2002 18:24:45 GMT

On Thursday, June 13, 2002, at 06:45 PM, Jon Scott Stevens wrote:

> on 6/12/02 11:53 PM, "James Strachan" <> wrote:
>> This was done originally by design. The XML introspector decides the
>> ordering of the bean properties. You can configure this order using a
>> BeanInfo. Or you can change this order via a .betwixt file for your bean.
> The output ordering must match the input ordering because generally there 
> is
> a DTD which defines what the order of the elements is.
>> The problem with using the input XML document as the decider of the 
>> order of
>> properties, is what happens if lots of different orderings are used in
>> different XML documents (or things are missing)? Which order wins?
> I'm sorry. That doesn't make sense to me. You have one input and one
> output...where are you getting this lots of different documents? The
> ordering of the input should match the output exactly.

i think that the problem boils down to the fact that betwixt has 
traditionally started from the other perspective - you make an output and 
then want to be able to read back from the generated output. it is 
possible (through configuration) for betwixt to produce different xml as 
output from the same beans. the idea is that with the same configuration, 
betwixt should be able to read back the xml and turn it into beans.

>> Though I do concur, it might be nice to let the parsing of XML order the
>> XMLBeanInfo automatically as it seems like a common use case. The way the
>> ordering works right now is not ideal. I've added this issue to the
>> todo.xml.
> Thanks...because until this is fixed, I can't use betwixt for anything
> useful.

am i right in assuming that ordering the element automatically from the 
parsing would only work if the same XMLIntrospector instance is used to 
read and write?

it's hard to see how betwixt could automatically guess the ordering 
without access to the DTD. it might be necessary to create betwixt file or 
an XMLBeanInfo class to correctly order the output.

- robert

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message