s the use of schemas grows, so does the need for tools to manipulate those schemas. IBM's new XML Schema Infoset Model provides a complete modeling of schemas themselves, including the concrete representations as well as the abstract relationships within a schema or set of schemas. This library easily queries the model of a schema for detailed information. You can also use it to update the schema to fix any problems found and write the schema back out.
Although there are a number of parsers and tools that use schemas to validate or analyze XML documents, tools that allow querying and advanced manipulation of schema documents themselves are still being built. The XML Schema Infoset Model (AKA the Java packages org.eclipse.xsd.*, or just "the library") provides a rich API library that models schemasboth their concrete representations (perhaps in a schema.xsd file) and the abstract concepts in a schema as defined by the specification. As anyone who has read the schema specs knows, they are quite detailed. The XML Schema Infoset Model strives to expose all the Infoset details within any schema. This allows you to efficiently manage your schema collection, and empower higher-level schema tools such as schema-aware parsers and transformers.
For a quick overview of the library showing all the schema objects modeled, please see the XML Schema Infoset Model UML diagrams. The XML Schema Infoset Model also includes the UML diagrams used in building the library interfaces themselves; these diagrams show the relationships between the library objects, which very closely mimic the concepts in the schema specifications.
The example in this article uses two files in the source code. The FindTypesMissingFacets.xsd file is a simplistic XML Schema that shows basic schema constructs. The FindTypesMissingFacets.java code shows how to use the power of the library to query and manipulate schemas. The example is intended to showcase the power of the XML Schema Infoset Model as one of the first libraries that allows simple and powerful schema manipulation.