Steve Loughran wrote:

>
> On the subject of data binding, it would suit me nicely if you could
> easily build an OMElement graph from a DOM or SAX tree.

What do you mean here ? Are you asking for a special OMElement which
wraps any data binding object, as Dennis explained.

> Because that way I could map from Xom to OMElement without printing
> everything to a StringBuffer and parsing it again.

BTW, you all agree that the only missing "feature" we should have in
Axis2, for it to be promoted for 1.0 status, is Axis2 own databinding
implementation. I think Ajith has almost completed XMLBeans integration.

So lets have a broader discussion on this.

One of the concerns raised in the last chat is the integration of data
bound object to OM.

So as I see there are two ways;

1. Getting pull parser from the data bound object, irrespective of which
framework was used to data bound, and create an OMElement out of it and
hangs that to the OM tree.

DataBoundObject dbObj = // get the data bound object
OMElement dbObjWrapper = new
StaxOMBuilder(dataBoundObject.getPullParser()).getDocumentElement();

// add this to body of wherever you want
body.addChild(dbObjWrapper);

2. Giving the data bound object an XSR (XMLStreamWriter) and ask him to
serialize himself
DataBoundObject dbObj = // get the data bound object
SpecialOMElement dbObjContainer = new SpecialOMElement(dbObj);
dbObjContainer.serialize(xmlStreamWriter);

(are there other approaches ? if so please comment)

I personally prefer the first approach as it seems cleaner for me. Its
the same thing we do to connect data in to OMElement. And it nicely and
elegantly fit in to the differed building approach. This approach is
almost implemented for ADB (Axis2 Data Binding).

Well the problem in that approach is that (thanks to Dennis for
pointing), JAXB, JiXB do not have a way of getting a pull parser. But
they do have a way of doing the second method.

So this is a summary to the discussions so far. Please please comment on
this and lets *implement* the better way of doing it.

-- Chinthaka

>
> -steve
>
>

Reply via email to