commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcos Truchado Martín <marcos.truchado.mar...@hp.com>
Subject Re: problem using betwixt
Date Mon, 20 Feb 2006 09:22:26 GMT
a BIG THANK YOU for you Robert, my code is now working ;).

robert burrell donkin escribió:
> hi Marcos
>
> On Thu, 2006-02-16 at 17:57 +0100, Marcos Truchado Martín wrote:
>
>   
>> /<?xml version='1.0' encoding='UTF-8' ?>
>> <info primitiveTypes='attribute'>
>>     <element name='first-element'>
>>         <attribute name="foo" property="field1"/>
>>         <attribute name="bar" property="field2"/>
>>         <addDefaults/>
>>     </element>
>> </info>/
>>
>> and this one is for Thing:
>>
>> /<?xml version='1.0' encoding='UTF-8' ?>
>> <info primitiveTypes='attribute'>
>>     *<element name='second-element'>*
>>         <attribute name="inside-thing" property="field3"/>
>>     </element>
>> </info>/
>>
>> The problem I´m having is that I get this XML:
>>
>> /<?xml version='1.0' encoding="ISO-8859-1"?>
>>   <first-element foo="1" bar="2">
>>     <thing inside-thing="3"/>
>>     <thing inside-thing="4"/>
>>   </first-element>/
>>
>> but my desired ouput is:
>>
>> /<?xml version='1.0' encoding="ISO-8859-1"?>
>>   <first-element foo="1" bar="2">
>>     <*second-element* inside-thing="3"/>
>>     <*second-element *inside-thing="4"/>
>>   </first-element>/
>>
>> where is my fault?
>>     
>
> betwixt (usually) takes the name from the property adder ('thing')
> rather than the class dot betwixt file. one way to output what you need
> is to specify the element name explicitly in the dot betwixt file:
>
> the following works for me with the latest code:
>
> <?xml version='1.0' encoding='UTF-8' ?>
> <info primitiveTypes='attribute'>
>    <element name='first-element'>
>        <attribute name="foo" property="field1"/>
>        <attribute name="bar" property="field2"/>
>          <element name='second-element' property='thingIterator'
> adder='addThing'/>
>         <addDefaults/>
>    </element>
> </info>
>
> - robert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>   


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message