commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [Question] Betwix & JAXB
Date Fri, 12 Apr 2002 02:53:25 GMT
From: "Ivelin Ivanov" <ivelin@apache.org>
>
> Hi James,
>
> Thanks for the detailed response.
>
> Yes, choice is healthy.
>
> I will hope however that the coices stay limited to 1 or 2 alternatives.
> More than that, it will almost sound like waste of brain.
>
> I am very happy with JXPath and therefore I would think that Betwix is the
> tool I'd use for marshaling in future.

FWIW I have nothing to do with JXPath at all - thats Dmitri's baby. I work
on Jaxen instead (I did try bring Dmitri to the Jaxen-party but he preferred
to go his own way).

http://jaxen.org

Jaxen is an XPath 1.0 conformant XPath engine which works on all popular XML
models. Its the primary XPath engine used by the dom4j, EXML and JDOM
communities. Also DOM users use it, for example David Megginson included
Jaxen for DOM XPath support in the Reuters NewsML toolkit.


> What I really appreciate about JXPath is that it is quite smart about auto
> handling mapping for various types.

Though picking a good default mapping is one thing; however there are
various ways to do it and sometimes developers want to specify this
explicitly - thats where betwixt comes in.

e.g. for a Map

Map map = new HashMap();
map.put( "a", "1234" );
map.put( "b", "5678" );


how should this look as XML? e.g.

<map>
    <entry key="a">1234</entry>
    <entry key="b">5678</entry>
</map>

Or

<map>
    <a>1234</a>
    <b>5678></b>
</map>

Or even

<map>
    <entry>
        <key>a</key>
        <value>1234</value>
    </entry>
    <entry>
        <key>b</key>
        <value>5678</value>
    </entry>
</map>



> An inconvenience of Castor is that it's virtually useless without explicit
> mapping.
> If Betwix is going to be a lot more transparent and not require mapping
for
> most cases, I'd certainly enjoy it.


Cool

> BTW, when mapping is not provided, how does betwix handle circular
> references during marshaling? Xlink?

Robert added support for handling of circular references. Right now it
outputs unique IDs and uses HREF attributes to refer to previously
serialized objects.

James


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message