commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Éderson Marcos Ferreira <ederso...@gmail.com>
Subject Working with several Lists
Date Sat, 28 Jan 2006 19:32:18 GMT
Hi,

I've been using Betwixt to convert xml file in JavaBeans. But I've
found some problems.
I have 4 classes: Config, Arrow, Tip and ElementB. In accordance with
the XML file below, inside of element 'elementA' I may have several
'arrow' elements and inside of element 'arrow' I may have several
'tip' elements, and after 'elementA' I have an 'elementB'. This works
almost perfectly, because Config class, used in the registerBeanClass
(reader.registerBeanClass(new InputSource(dotBetwixtDocument),
Config.class)), is constructed with the elements 'arrow'(which is a
List in Config class) and 'elementB', but for the element 'tip'(which
is a List in Arrow class) doesn't work. The attribute 'tip' in the
class Arrow is empty.

What it happens?
Thank's very much.
Ederson Ferreira

My XML file follows the structure below:
<config>
	<elementA>
		<arrow att1="X" att2="Y" att3="Z">
		  <tip att4="W" att5="true" att6="false" />
		  <tip att4="U" att5="false" att6="true" />
		</arrow>

		<arrow att1="K" att2="L" att3="M">
		  <tip att4="R" att5="true" att6="false" />
		  <tip att4="S" att5="false" att6="true" />
		</arrow>
	</elementA>
    <elementB att7="Q" />
<config>

My .betwixt document, inside application:
<?xml version='1.0' encoding='UTF-8' ?>
<info primitiveTypes='attribute'>
	<element name='config'>

		<element name='elementA'>
			<element name='arrow'
					 class='com.emf.tests.Arrow'
					 property='arrowa'>
					<attribute name='att1' property='att1'/>
					<attribute name='att2' property='att2'/>
					<attribute name='att3' property='att3'/>

					<element name='tip'
						 class='com.emf.tests.Tip'
						 property='tips'>
						<attribute name='att4' property='att4'/>
						<attribute name='att5' property='att5'/>
						<attribute name='att6' property='att6'/>
					</element>

			</element>
		</element>

		<element name='elementB'
			 class='com.emf.tests.ElementB'
			 property='elementB'>
			<attribute name='att7' property='att7'/>
		</element>

		<addDefaults/>
	</element>
</info>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message