commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kapil Pruthi" <kapil.pru...@gmail.com>
Subject Re: JAKARTA COMMONS DIGESTER RULES XML PROBLEM
Date Thu, 01 Nov 2007 17:56:07 GMT
excellent, I will try this and let u know.

On 11/1/07, Björn Thalheim <bjoern.thalheim@gmx.de> wrote:
>
> 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
>

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