commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Björn Thalheim <bjoern.thalh...@gmx.de>
Subject Re: JAKARTA COMMONS DIGESTER RULES XML PROBLEM
Date Thu, 01 Nov 2007 07:55:55 GMT
Hi,

Kapil Pruthi schrieb:
> Can betwixt be used to transform xml to java? on overview page i read that
> it can only do java to xml

In our Project (I personally joined in late) we do it (reading the 
contents of XML files into Beans) like this:

<<<<< snip >>>>>
BeanReader reader = new BeanReader();
final IntrospectionConfiguration xmlconf =
	reader.getBindingConfiguration();
xmlconf.set...(...);
final BindingConfiguration bindconf = reader.getBindingConfiguration();
bindconf.set...(...);
reader.setNamespaceAware(true);
// this is the most important step
reader.registerBeanClass(MyClass.class)
...
// here, read in the contents of one XML file to the corresponding Bean.
MyClass mc = (MyClass)reader.parse(InputStream in);
<<<<< snap >>>>>

I hope this is what you need and you have already:
- all XML files, and
- all Bean classes.

If you don't have any Bean class which you can register, then betwixt 
can't help you. First, you'd have to create the Bean class files 
according to the XML files.

Let us know, if you can work with this, at least I'm curious about it;-)

By the way: betwixt internally uses commons digester.

Regards,

Björn

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


Mime
View raw message