JAXB: Mapping XML to Existing Java Objects??

Discussion in 'Java' started by John Davison, Jul 22, 2004.

  1. John Davison

    John Davison Guest

    In Castor I can defined how I want to map existing XML to an existing
    (not auto-generated) object. Can I do the same in JAXB? I have
    searched the JAXB documentation, but haven't found a way to map XML to
    Java without having JAXB generate the Java classes from a schema.

    http://castor.exolab.org/xml-mapping.html

    -- John
    John Davison, Jul 22, 2004
    #1
    1. Advertising

  2. John Davison

    iksrazal Guest

    (John Davison) wrote in message news:<>...
    > In Castor I can defined how I want to map existing XML to an existing
    > (not auto-generated) object. Can I do the same in JAXB? I have
    > searched the JAXB documentation, but haven't found a way to map XML to
    > Java without having JAXB generate the Java classes from a schema.
    >
    > http://castor.exolab.org/xml-mapping.html
    >
    > -- John


    Having a XML schema is the heart of JAXB in its current form - without
    one nothing can happen. And it uses a schema to auto generate java
    source files. Any vision of something that does not have at least
    those two steps is not in the scope of JAXB, as I understand it.

    Any questions that first involve those two steps I might be able to
    help out with, as I'm doing a lot with JAXB at the moment.

    HTH

    Outsource to an American programmer living in brazil!
    http://www.braziloutsource.com/
    iksrazal
    iksrazal, Jul 23, 2004
    #2
    1. Advertising

  3. John Davison

    John Davison Guest

    (John Davison) wrote in message news:<>...
    > In Castor I can defined how I want to map existing XML to an existing
    > (not auto-generated) object. Can I do the same in JAXB? I have
    > searched the JAXB documentation, but haven't found a way to map XML to
    > Java without having JAXB generate the Java classes from a schema.
    >
    > http://castor.exolab.org/xml-mapping.html
    >
    > -- John


    Perhaps JSR 222 will address this issue?

    http://www.jcp.org/en/jsr/detail?id=222

    -- John
    John Davison, Jul 26, 2004
    #3
  4. John Davison

    iksrazal Guest

    (John Davison) wrote in message news:<>...
    > (John Davison) wrote in message news:<>...
    > > In Castor I can defined how I want to map existing XML to an existing
    > > (not auto-generated) object. Can I do the same in JAXB? I have
    > > searched the JAXB documentation, but haven't found a way to map XML to
    > > Java without having JAXB generate the Java classes from a schema.
    > >
    > > http://castor.exolab.org/xml-mapping.html
    > >
    > > -- John

    >
    > Perhaps JSR 222 will address this issue?
    >
    > http://www.jcp.org/en/jsr/detail?id=222
    >
    > -- John


    As for what you said what you're looking for, doesn't seem like it.
    Its backwards compatible with JSR31. The focus this time around seems
    to be more complete schema support (a notoriously complex spec), web
    services stuff like serialization/de-serialization issues and binding
    to WSDL datatypes , and for my needs a cool feature - binding to "only
    parts of an XML document."

    So you still need a xml schema, which creates auto-generated source.
    That hasn't changed best I can tell.

    JSR31 changed a bunch though - starting with a DTD requirement and
    then going to a xml schema requirement. And it took forever - starting
    in 1999 and only becomming usable IMHO within the last year or so.
    Since this JSR is in "Early Draft" we'll just have to wait and see. I
    wasn't aware of JSR222 though - thanks.

    iksrazal
    iksrazal, Jul 26, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Petterson Mikael

    XML to java using JAXB ?

    Petterson Mikael, Sep 2, 2003, in forum: Java
    Replies:
    0
    Views:
    384
    Petterson Mikael
    Sep 2, 2003
  2. SOndei
    Replies:
    0
    Views:
    398
    SOndei
    Jan 15, 2004
  3. Jean-Marie Condom
    Replies:
    2
    Views:
    390
    Jean-Marie Condom
    Nov 26, 2004
  4. nrm
    Replies:
    3
    Views:
    512
  5. Anna
    Replies:
    0
    Views:
    1,988
Loading...

Share This Page