From: "robert burrell donkin" <[EMAIL PROTECTED]>
>
> On Tuesday, August 28, 2001, at 02:17 PM, James Strachan wrote:
>
> > FWIW the betwixt subproject in the sandbox is an attempt to provide bean
> > to
> > XML mapping meta-data in a similar way to what the java.beans.BeanInfo
and
> > Introspector classes do for mapping a bean to properties & events.
> >
> > At the moment I'm focussing mostly on mapping a bean into XML so that
XSLT
> > and XPath can be done on them - though it wouldn't be that hard to make
> > the
> > mapping bidirectional. (Then we'd have the basis of a bidirectional bean
> > <->
> > XML serialization framework). So given a mapping of a bean <-> XML
mapping
> > via betwixt it could be possible to auto-generate digester rules that
> > could
> > turn the XML into the beans.
> >
> > Just a thought...
>
> hi james
>
> i've taken a quick look at betwixt (mainly with the aim of determining
> whether your idea's viable) but there really isn't anything to get me
> started.

Me and my big mouth :-)


> any chance of help pointing me in right direction?

Currently the mapping works from a bean to XML and not the other way around.
e.g. if you look at org.apache.commons.betwixt.io.BeanWriter its a simple
bit of code that uses the betwixt API to write a bean as some XML using the
XMLIntrospector and XMLBeanInfo API.

Just as we lookup properties via BeanInfo and Introspector right now,
betwixt is similar with XMLBeanInfo and XMLIntrospector, except its
ElementDescriptors and AttributeDescriptors, rather than
PropertyDescriptors.

To do what you need we'd need to go the other way around so that we can turn
XML (sax events) into calls to set bean properties. Right now the betwixt
API doesn't quite support that yet, it only supports getters rather than
setters.

I'll think some more about this and send another mail to the list - I'm
about to go on vacation for a week so it'll be a little time before I get
back.

James



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to