Apache XmlSchema is a Java class library for W3C Xml Schema version 1.0.


Apache XmlSchema was created, and is still maintained, to serve the needs of web service frameworks that define messages via W3C XML Schema. Frameworks that are 'code first' need to create XML Schemas, while 'contract first' frameworks need to analyze them.


Apache XMLSchema provides an object model for W3C Xml Schema 1.0. There is a Java class for each item defined in the schema specification. The library can read an XML Schema XML document and populate the object model and serialize the object model back out to XML Schema XML documents. In between, an application can create, destroy, and modify the items in the schema. The library includes the concept of a 'schema collection' – a group of interrelated schemas. The classic example would be the collection of schemas embedded in a single WSDL.

Apache XmlSchema does not, in contrast, work with instance documents. It cannot validate an instance document, nor create one. This functionality is provided in modern implementations of Java, and in Apache Xerces, as well as in the MSV library.

Apache XmlSchema does not provide validation of XmlSchema documents; Apache Xerces provides an API for that purpose.


Apache XmlSchema is part of the Apache Web Services PMC, managed within the Commons subproject. Both users and developers communicate via the commons-dev@ws.apache.org mailing list.

Branches and Versions

The current release branch for XmlSchema is the 1.4 branch. We anticipate a release of XmlSchema 2.0 in the near term.

XmlSchema 1.4.x

XmlSchema 1.4.x is compatible with Java 1.4, and is the version used in Apache CXF 2.3, Apache Axis2, and other projects.

Download, javadoc, and other information for that branch can be found at http://ws.apache.org/commons/xmlschema14.

XmlSchema 2.0

XmlSchema 2.0 is new version, rationalizing many issues in the API and using Java 1.5 Generics to provide a type-safe API.

Other Tools for Working with XML Schema

  • Apache Xerces can parse, and validate XML Schema document, use them to validate instance documents. It also provides an API for navigating their structure. It does not allow for creation or modification other than via an ordinary DOM tree.
  • The Eclipse project includes a class library for XML Schema documents.

Some Development Information

XmlSchema Release Management describes release management.

XmlSchema Development Plans describes the current branches and plans.

  • No labels