|
Apache XMLBeans is a Java-XML binding tool through which you can access the full power of XML in a Java-friendly way. With XMLBeans, you have a familiar and convenient Java object-based view of XML data without losing access to the richness of the original, native XML structure and schema. BEA originated XMLBeans, and in September 2003 donated it to the Apache Software Foundation. XMLBeans will continue to be essential part of WebLogic Platform, providing underlying support for XML processing throughout the platform.
XMLBeans provides three major APIs for access to XML and schema:
Strongly-typed access with XmlObject as a base type
You can compile XML schema to generate Java types. 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.
Type-agnostic access through the XmlCursor interface
From any XmlObject you can get an XmlCursor instance. This provides efficient, low-level access to the XML infoset. A cursor represents a position in the XML instance. You can move the cursor around the XML instance at any level of granularity you need from individual characters to Tokens.
Access to schema through the SchemaType interface
XMLBeans provides a full XML schema object model that you can use to reflect on the underlying schema meta information. For example, you might want to generate a sample XML instance for an XML schema or perhaps find the enumerations for an element so that you can display them.
XMLBeans fully supports XML schema; classes generated from schema provide constructs for all of the major functionality of XML schema. In addition, XMLBeans preserves the full XML infoset, including the subset of XML that is not easily represented in Java (including element order and comments).
|