On Feb 17, 2009, at 7:23 PM, Tatu Saloranta wrote:
> --- On Tue, 2/17/09, Paul Sandoz <Paul.Sandoz_at_Sun.COM> wrote:
>
> ...
>>> So I like many things in JAXB per se; but the baggage
>> of xml compatiblity (including using stax API which likewise
>> is not a good match with json) is the problem.
>>
>> I would say not a perfect match :-)
>
> Fair enough! :)
>
>> My hope is that we may have hit a reasonably 80% mark, but
>> we need some more data to ascertain that. I want to compare
>> XML to the "natural" JSON to badger fish JSON for
>> a complex piece of XML, say using UBL purchase orders.
>
> I would be interested in helping with this. Can you point me to a
> sample document or two (plus if need be, specs)?
> I wouldn't mind creating a conversion (depending on complexity,
> either manual or automated)
>
IIRC the following has examples:
http://docs.oasis-open.org/ubl/os-UBL-2.0.zip
Also if i remember correctly the W3C EXI test suite has some UBL
examples as well, but i cannot remember if the schema is available or
not.
I cannot remember if the Japex framework already has JAXB beans auto-
generated for UBL, possibly part of fi.dev.java.net instead.
As you can see my memory is a little hazy for previous projects i
worked on :-)
> My interest here relates to "StaxBind" data format benchmark I have
> written -- it's neat for comparing data formats, libs, for different
> payloads; but I need more general purpose sample data. There isn't
> that much available, so I have converted some xml sample docs using
> convention-based transforms
OK.
>
> (we can take this discussion off-line; anyone interested let me know
> and I can give more details, but it gets bit offtopic here)
>
Fine here by me.
> ...
>>> Perhaps that's to be handled with body handlers?
>>
>> It can, because the media types are different. IIUC Java
>> YAML supports any Java type for serialization, i am
>> surprised there is not something for JSON that does
>> something similar.
>
> There are actually. :)
>
Ah!
> I know Jackson does full serialization/deserialization (with
> annotation support with 0.9.8), and I think google-gson does too
> (according to their docs, haven't tried using it)
> And I think "json tools" may have support for this as well -- bit
> hard to judge by documentation.
> These are all fairly recent developments though, so there may be
> issues with maturity. But at least there is progress, which was
> lacking up until maybe 9 months ago.
>
OK. That is good to hear.
> JAXB (and XStream too) was an inspiration for jackson's data
> binding; and I am hoping to even support use of subset of JAXB
> annotations.
> So there is definitely some synergy in there.
>
Definitely.
Paul.