HOME

TheInfoList



OR:

XMLBeans is a
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
-to- XML binding
framework A framework is a generic term commonly referring to an essential supporting structure which other things are built on top of. Framework may refer to: Computing * Application framework, used to implement the structure of an application for an op ...
which is part of the
Apache Software Foundation The Apache Software Foundation (ASF) is an American nonprofit corporation (classified as a 501(c)(3) organization in the United States) to support a number of open source software projects. The ASF was formed from a group of developers of the A ...
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
project.


Description

XMLBeans is a tool that allows access to the full power of XML in a Java friendly way. The idea is to take advantage of the richness and features of XML and
XML Schema An XML schema is a description of a type of Extensible Markup Language, XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed ...
and have these features mapped as naturally as possible to the equivalent Java language and typing constructs. XMLBeans uses XML Schema to compile Java interfaces and classes that can then be used to access and modify XML instance data. Using XMLBeans is similar to using any other Java interface/class: with methods like getFoo or setFoo, just as when working with Java. While a major use of XMLBeans is to access XML instance data with strongly typed Java classes there are also APIs that allow access to the full
XML infoset XML Information Set (XML Infoset) is a W3C specification describing an abstract data model of an XML document in terms of a set of ''information items''. The definitions in the XML Information Set specification are meant to be used in ''other'' sp ...
(XMLBeans keeps XML Infoset fidelity) as well as to allow reflection into the XML schema itself through an XML Schema Object model.


Characteristics of XMLBeans

# Large
XML Schema An XML schema is a description of a type of Extensible Markup Language, XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed ...
support. # Large
XML Infoset XML Information Set (XML Infoset) is a W3C specification describing an abstract data model of an XML document in terms of a set of ''information items''. The definitions in the XML Information Set specification are meant to be used in ''other'' sp ...
support. Large XML Schema support: XMLBeans fully supports XML Schema and the corresponding java classes provide constructs for all of the major functionality of XML Schema. This is critical since often one has no control over the features of XML Schema needed to work with in Java. Also, XML Schema oriented applications can take full advantage of the power of XML Schema and not have to restrict themselves to a subset. Large XML Infoset support: When unmarshalling an XML instance the full XML infoset is kept and is available to the developer. This is critical because that subset of XML is not easily represented in Java. For example, order of the elements or comments might be needed in a particular application.


Objective

A major objective of XMLBeans has been its applicability in all non-streaming (in memory) XML programming situations. The developer should be able to compile their XML Schema into a set of Java classes and know that they will be able to: # use XMLBeans for all of the schemas they encounter. # access the XML at whatever level is necessary without other tools.


APIs

To accomplish the above objectives, XMLBeans provides three major APIs: * XmlObject * XmlCursor * SchemaType XmlObject: The java classes that are generated from an XML Schema are all derived from XmlObject. These provide strongly typed getters and setters for each of the elements within the defined XML. Complex types are in turn XmlObjects. For example, getCustomer might return a CustomerType (which is an XmlObject). Simple types turn into simple getters and setters with the correct java type. For example, getName might return a String. XmlCursor: From any XmlObject the developer can get an XmlCursor. This provides efficient, low level access to the XML Infoset. A cursor represents a position in the XML instance. The cursor can be moved around the XML instance at any level of granularity needed from individual characters to Tokens. SchemaType: XMLBeans provides a full XML Schema object model that can be used to reflect on the underlying schema meta information. For example, the developer might generate a sample XML instance for an XML schema or perhaps find the enumerations for an element so that they may be displayed.


Example

An example of a simple XML Schema Definition to describe a country is given below. ISO 3166 -Z/> -Z/> When the schema is compiled into XMLBean classes (e.g., using
Ant Ants are eusocial insects of the family Formicidae and, along with the related wasps and bees, belong to the order Hymenoptera. Ants evolved from vespoid wasp ancestors in the Cretaceous period. More than 13,800 of an estimated total of 22 ...
), it is very easy to create and manipulate XML data that conforms to the schema definition. The following Java code is a simple example that illustrates how an XML document can be created and validated. import org.openuri.domain.country.v1.Country; import org.openuri.domain.country.v1.Iso; public class CountrySample


History

David Bau was the chief designer for the XMLBeans 1.0 project while he was working for BEA. XMLBeans started on the grounds of XMLMaps, an XML binding tool included in previous BEA
WebLogic Oracle WebLogic Server is a Java EE application server currently developed by Oracle Corporation. Oracle acquired WebLogic Server when it purchased BEA Systems in 2008. Application Server versions * WebLogic Server 14c (14.1.1) - March 30, 2020 ...
products. XMLBeans was originally developed as part of the proprietary BEA
WebLogic Oracle WebLogic Server is a Java EE application server currently developed by Oracle Corporation. Oracle acquired WebLogic Server when it purchased BEA Systems in 2008. Application Server versions * WebLogic Server 14c (14.1.1) - March 30, 2020 ...
Workshop Framework, but it was obvious from interviews conducted when it was first announced on January 27, 2003, that BEA wanted it to become an open standard. At that time it was not decided which organization BEA wanted to involve in the standardization effort. Later that year it was donated to the Apache Software Foundation. The original team included Cezar Cristian Andrei and Eric Vasilik, later the team added Cliff Schmidt and Radu Preotiuc-Pietro, Jacob Danner, Kevin Krouse and Wing Yew Poon. XMLBeans is now being developed by
Apache POI The Apache () are a group of culturally related Native American tribes in the Southwestern United States, which include the Chiricahua, Jicarilla, Lipan, Mescalero, Mimbreño, Ndendahe (Bedonkohe or Mogollon and Nednhi or Carrizaleño and ...
. * January 27, 2003: BEA announces XMLBeans as a technology preview. * September 24, 2003: BEA donates XMLBeans to the Apache Software Foundation where it joins the Apache Incubator Project. * April 23, 2004: XMLBeans Version 1.0.2 is released. This is the first release from the incubator project. * June 25, 2004: XMLBeans graduated out of the Apache Incubator Project to become top level project. * June 30, 2005: XMLBeans Version 2.0 is released. * November 16, 2005: XMLBeans Version 2.1 is released. * June 23, 2006: XMLBeans Version 2.2 is released. * June 1, 2007: XMLBeans Version 2.3 is released. * July 8, 2008: XMLBeans Version 2.4 is released. * December 14, 2009: XMLBeans Version 2.5 is released. * August 14, 2012: XMLBeans Version 2.6 is released. * May 23, 2014: XMLBeans was officially retired and active development was ceased temporarily. * June 29, 2018: XMLBeans was "unretired" and Apache POI took over active development.


See also

*
XML data binding XML data binding refers to a means of representing information in an XML document as a business object in computer memory. This allows applications to access the data in the XML from the object rather than using the DOM or SAX to retrieve the data ...
*
Java Architecture for XML Binding Java XML Binding (JAXB; formerly Java Architecture for XML Binding) is a software framework that allows Java EE developers to map Java classes to XML representations. JAXB provides two main features: the ability to ''marshal'' Java objects into ...
(JAXB) *
xmlbeansxx xmlbeansxx is a software framework for C++ to XML binding. It is open-source software licensed under Apache License 2.0. Description xmlbeansxx is a tool allowing access to XML in a C++ friendly way. It is similar to, and inspired by, the Apa ...
XML Data Binding XML data binding refers to a means of representing information in an XML document as a business object in computer memory. This allows applications to access the data in the XML from the object rather than using the DOM or SAX to retrieve the data ...
code generator for
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...


References


External links

*
XMLBeans resources

The Apache XML project



XML Binding Resources - xbeans of popular schemas
{{DEFAULTSORT:Xmlbeans
XMLBeans XMLBeans is a Java-to- XML binding framework which is part of the Apache Software Foundation XML project. Description XMLBeans is a tool that allows access to the full power of XML in a Java friendly way. The idea is to take advantage of the richn ...
Java platform Java development tools XML parsers