Women in Technology

Hear us Roar



Article:
  XML-Java Data Binding Using XMLBeans
Subject:   Why ?
Date:   2004-07-30 13:22:30
From:   seapwc
There is already a JAXB that does the java xml
binding? What does this offer that is needed ?
Full Threads Newest First

Showing messages 1 through 3 of 3.

  • Why ?
    2004-08-04 09:36:36  myshkin5 [View]

    We use JAXB on my current project and I can say that XMLBeans offers much that we desire:

    1. Namespace/package/inner class support. JAXB forces you to put all of your XSDs in one directory and all of the resulting Java code is in one package. JAXB also makes no use of inner classes so if you have element buried down in a schema called 'item' you now have a plain top level class called Item. In our medium sized project, our generated code directory has 352 .java files. JAXB is simply unmanagable in a large project.

    2. Near 100% XML Schema support. Many nice little tricks in an XSD don't translate to Java code in JAXB.

    Disclaimer: I haven't used XMLBeans. I'm sure it has it's warts too.
  • Why ?
    2004-08-04 16:04:18  Hetal [View]

    Some of the significant features of XMLBeans are:



    1. XMLBeans is based on an efficient XML token stream, and it keeps underlying XML infoset intact. Since XMLBeans keeps the data in memory as XML, overhead of unmarshalling and marshalling is reduced.

    2. To address varying data access and data transformation requirements, XMLBeans provides a flexibility of navigating through xml data using xPath or xQuery, and manipulating xml data using either xml cursor or XMLBeans generated classes.

    3. In JAXB 1.0 , group binding style does not follow node correspondence. so developer has to be aware of group binding node that does not correspond to any node in xml instance data.



    XMLBeans offers performance benefits (mentioned in article), flexibility in navigating through xml data, and provision for executing xpath queries against xml instance data.

    -Hetal Shah.
  • Why ?
    2004-09-25 15:09:26  Deepak Vohra | [View]

    Some of the advantages of XMLBeans over JAXB are the provision to parse an XML document and support for all of the XML Schema constructs; the JAXB generated classes do not have a parse method to parse an XML document and JAXB does not support all the Schema constructs.