commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Kraft <kr...@synyx.de>
Subject Re: [betwixt] saving/reading more than one bean in the same xml file
Date Fri, 13 May 2005 15:31:26 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Then you should check the TestMultimapping test case that comes with
> betwixt (view in SVN here:
> http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/betwixt/trunk/src/test/org/apache/commons/betwixt/TestMultiMapping.java?view=markup)
> This should help get you started.

I tried the checkout and built the latest svn-version. I also tried to
look into the mentioned test-case, but that did not really helped me.

In the test case there is one bean holding another bean of different
type, which is written to and read from the xml file. That already
worked for me.

What i try to do is, i have several beans of the same type (e.g.
TestBean) and i would like to store all of them in the same xml file.
This will not work because of not-wellformed xml:

<?xml version='1.0' ?>
  <testBean1>
    <description>TestDescription</description>
  </testBean1>
  <testBean2>
    <description>TestDescription</description>
  </testBean2>
  <testBean3>
    <description>TestDescription</description>
  </testBean3>

What i want to do is having several beans of the same (or different)
type in one xml file and tell betwixt with a construct like:
beanReader.registerBeanClass("testBean" + i, AdditionalBean.class);
that it should take the named bean out of that file.

Isn't there any type of "dummy-container" where i can put all my bean
data into and getting it out by telling betwixt the name i like to have?
(simply to get wellformed xml file)

e.g.:
<?xml version='1.0' ?>
<dummyContainer>
  <testBean1>
[...]
  </testBean3>
</dummyContainer>

That would be very easy and i wonder if this issue is so hard for me to
solve :(

Still trying to get a solution,

Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFChMhNnPtETagUFaYRAvmbAJ0Rq8/gXlr3bskq+b85lrEErNy3jQCcCfLu
47+yTPMihwFPsrfk8NWFejU=
=gavm
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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