You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by robert burrell donkin <ro...@blueyonder.co.uk> on 2004/12/01 22:16:18 UTC
Re: [betwixt] element without name attribute in do betwixt file?
hi Christoph
i've committed some changes which should allow you to miss off the name
for your collection.
- robert
On 29 Nov 2004, at 19:48, Christoph Gaffga wrote:
> hi all,
>
> I have a collection containing differen instances. Now I output the XML
> using betwixt with a dot-betwixt-file containing:
>
> <?xml version="1.0" encoding="ISO-8859-15"?>
> <info primitiveTypes="element">
> <element name="MyTest">
> <element name="list">
> <element name="item" property="collection"/>
> </element>
> </element>
> </info>
>
> where my collection is an instance of ArrayList. I get a result like:
>
> <MyTest>
> <list>
> <item>5</item>
> <item>a string</item>
> <list>
> </MyTest>
>
> That's fine. Bus what if I would like it to be:
>
> <MyTest>
> <list>
> <Integer>5</Integer>
> <String>a string</String>
> <list>
> </MyTest>
>
> or for instances of complex classes their name from their
> dot-betwixt-file.
>
> I looked into the DTD and saw the name-attribute is required. so I cant
> write something like:
> <element property="collection"/>
> but that is excatliy what I like to do, have the name depanding on the
> instance.
>
> Is there another way to have this done. Can I plug this somewhere.
> Any Ideas?
>
> regards,
> Christoph
> cgaffga@triplemind.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [betwixt] element without name attribute in do betwixt file?
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 2 Dec 2004, at 12:57, Christoph Gaffga wrote:
>
> Thanks, that works great.
> I'm away for a week, but when back, I will sent a patch for the docs
> about it. Perheaps there are more people finding it usefull.
great - documentation patches rule :)
- robert
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [betwixt] element without name attribute in do betwixt file?
Posted by Christoph Gaffga <cg...@triplemind.com>.
Thanks, that works great.
I'm away for a week, but when back, I will sent a patch for the docs
about it. Perheaps there are more people finding it usefull.
regards
Christoph
robert burrell donkin wrote:
> hi Christoph
>
> i've committed some changes which should allow you to miss off the name
> for your collection.
>
> - robert
>
> On 29 Nov 2004, at 19:48, Christoph Gaffga wrote:
>
>> hi all,
>>
>> I have a collection containing differen instances. Now I output the XML
>> using betwixt with a dot-betwixt-file containing:
>>
>> <?xml version="1.0" encoding="ISO-8859-15"?>
>> <info primitiveTypes="element">
>> <element name="MyTest">
>> <element name="list">
>> <element name="item" property="collection"/>
>> </element>
>> </element>
>> </info>
>>
>> where my collection is an instance of ArrayList. I get a result like:
>>
>> <MyTest>
>> <list>
>> <item>5</item>
>> <item>a string</item>
>> <list>
>> </MyTest>
>>
>> That's fine. Bus what if I would like it to be:
>>
>> <MyTest>
>> <list>
>> <Integer>5</Integer>
>> <String>a string</String>
>> <list>
>> </MyTest>
>>
>> or for instances of complex classes their name from their
>> dot-betwixt-file.
>>
>> I looked into the DTD and saw the name-attribute is required. so I cant
>> write something like:
>> <element property="collection"/>
>> but that is excatliy what I like to do, have the name depanding on the
>> instance.
>>
>> Is there another way to have this done. Can I plug this somewhere.
>> Any Ideas?
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org