XMLBeans

XMLBeans is a software package for Java, which makes it possible to bind data from an XML schema out automatically to Java classes. This process is called XML data binding. This allows work with XML documents, without the programmer interfaces for processing XML like SAX or DOM must use. XMLBeans is part of the Apache XML project.

Operation

Apache XMLBeans uses XML Schema definition to generate Java classes and interfaces. If the XML schema should not be present, Apache XMLBeans can generate a schema based on an XML document.

The information generated by Apache XMLBeans Java classes and interfaces - can be processed by means of the getter and setter methods - as with JavaBeans familiar. Moreover, can be accessed from Java to the rest of the XML information such as the order of the elements in the XML document. XMLBeans has mastered all the skills of XML schemas.

Apache XMLBeans offers the development tools to generate XML documents and Java classes following three programming interfaces:

Example

The following example is based on an XML schema definition for the description of a country:

  < xs: schema targetNamespace = " http://www.openuri.org/domain/country/v1 "              xmlns: tns = " http://www.openuri.org/domain/country/v1 "              xmlns: xs = " http://www.w3.org/2001/XMLSchema "              elementFormDefault = "qualified "              attributeFormDefault = "unqualified"              version = "1.0" >                                             < / xs: sequence>     < / xs: complexType>           ISO 3166 < / xs: documentation > < / xs: annotation >                                     < / xs: sequence>     < / xs: complexType>                         < / xs: restriction >     < / xs: simpleType>                                 < / xs: restriction >     < / xs: simpleType>                                 < / xs: restriction >     < / xs: simpleType>   < / xs: schema> For this scheme with the XMLBeans tools scomp (Scheme compiler ) or XMLBeans ( an Ant task) Java classes can now be created that can generate and manipulate that XML data corresponding to the given schema. The following Java code shows how to order an XML document can be generated and validated:

History

Apache XMLBeans was founded in 2003 under the name of David XMLBeans construction, as this worked for BEA Systems. It was based on XmlMaps, formerly XML binding framework of BEA WebLogic Server. XMLBeans was originally a proprietary component of the " BEA WebLogic Workshop " frameworks. On 27 January 2003 it was presented as a preview version. On 24 September of the same year BEA XMLBeans donated to the Apache Software Foundation, where it was accepted as an Apache Incubator project.

On 23 April 2004, version 1.0.2 was completed as the first version with Apache. On 25 June of the same year XMLBeans was a top-level Apache project. On June 30, the version 2.0 was released. They included the following improvements: Improved integration of XQuery and XPath support for DOM Level 2, improved error handling, ways to extend the generated XMLBeans, performance improvements, support the published with Java 5 generics, generation of XML documents from XML Schemas and vice versa.

The current version is Apache XMLBeans 2.6 from 14 August 2012. Brought you, among other things simple mapping of simple types to arbitrary Java classes as well as many small enhancements and bug fixes.

Alternatives

The following frameworks for the XML binding in Java can be used as an alternative to Apache XMLBeans:

Pictures of XMLBeans

72093
de