Discussions

XML & Web services: JAXB vs Castor

  1. JAXB vs Castor (8 messages)

    Hi,

    Can someone please help me to compare JAXB with Castor.

    Since JAXB supports schema now,Is is fine to go for JAXB. Of Course the spec is still not finalized. Not sure whether the current implementation is bug free.

    Castor being a non standard, I am not sure whether it is good to use it in my project.

    Thanks in advance.

    Pradeep

    Threaded Messages (8)

  2. XML data binding resources[ Go to top ]


    Please read: http://jinx.swiki.net/327

  3. Castor works great[ Go to top ]

    I am not sure about the differences. I have used Castor in my project and is working great. Now I am trying to find the differences between Castor and XML Beans.
  4. JAXB compared to Castor[ Go to top ]

    Following were some of my findings:

    1) Castor requires a very small download of 1 zip file. JAXB is part of a rather big download of Java Web Services develoment package and comes as a binary installation.

    2) Castor can be used to marshall an existing java object to XML. This is possible because Castor can use reflection for marshalling and unmarshalling. JAXB does not offer this functionality.

    3) Both Castor and JAXB can generate java source code from XML schema which can then be used for marshalling and unmarshalling java objects.

    4) Castor uses a mapping file that controls what sort of XML tree is generated by marshalling a java object. JAXB uses annotations to XML or an external binding file to control mapping between XML and java.

    In summary, if you have existing java classes that you want to serialize to XML and back, Castor will be the only choice. However if you do not have existing java classes, and want to generate them from XML Schema then either of them can be used.
  5. JAXB vs Castor[ Go to top ]

    You can find the comparision here.

    It seems JAXB's performance is good and Castor's memory management is good. So basically both have flaws.

    http://www-128.ibm.com/developerworks/xml/library/x-databdopt2/
  6. Castor Mapping.xml[ Go to top ]

    We are planning to use castor in our project. Can anyone suggest a good tool to generate the mapping.xml?
  7. Re: Castor Mapping.xml[ Go to top ]

    We are planning to use castor in our project. Can anyone suggest a good tool to generate the mapping.xml?
    What we did is generate from an XSD. Our XSD contained all the information about the structure of the XML and Element names as class names. Using the SourceGenerator.java we generated the Castor objects. There are a lot of tools to edit XSD files.. so my suggestion is to write a XSD schema file... and then use it to generate Castor objects.
  8. what about XMLBeans[ Go to top ]

    Hi, I used XMLBeans for a similar purpose a while back (maybe 2 years). At the time it was a BEA product. Is it still around and how usable is it outside a BEA env (we're on Oracle 10G AS)? How does it stack up against Castor or JAXB? Thanks. James
  9. Re: what about XMLBeans[ Go to top ]

    Hi, I used XMLBeans for a similar purpose a while back (maybe 2 years). At the time it was a BEA product. Is it still around and how usable is it outside a BEA env (we're on Oracle 10G AS)? How does it stack up against Castor or JAXB? Thanks. James
    We are using XML Beans in a non-BEA enviroment.. they are working great :)