www.alphaworks.ibm.comwww.ibm.com/developerwww.ibm.com

Home

XML4J Readme
Xerces Readme
Installation

API Docs
Samples
Schema

Properties
Features
FAQs

Releases
Caveats
Feedback

Y2K Compliance

Disclaimer
 

This package contains an implementation of the W3C XML Schema language. This implementation is experimental. The XML Schema language is still in working draft stage: you should not consider this implementation complete or correct. The limitations of this implementation are detailed below. Please read this document before using this package.


Introduction
 

This package contains an implementation of a subset of the W3C XML Schema Language as specified in the 17 December 1999 Working Drafts for Structures and Datatypes. The parsers contained in this package are able to read and validate XML documents with the grammar specified in either DTD or XML Schema format. There is no functionality for accessing typed data.

We are making this package available in order to get feedback on the features in the XML Schema language design and on representing an XML document's grammar as part of the document's DOM tree. We intend to update this package until it implements all of the functionality of the then current XML Schema Working Draft. If you are interested in a particular unimplemented feature, we welcome your feedback on the Xerces-J mailing list.


Limitations
 

The XML Schema implementation in this package is a subset of the features defined in the 17 December 1999 XML Schema Working Drafts.


Structure Limitations
 
  • elements, types, groups and attributeGroups share the same namespace
  • All types, elements, groups and attributeGroups must be declared before they are used.
  • On types the following are unsupported:
    • final, abstract, exact, nullable.
    • nested element declarations
  • Only the <any/> wildcard is supported
  • Type derivation (section 3.6) is not supported
  • Unique, key and key reference constraints (section 3.7) are not supported.
  • None of the mechanisms in section 4, are supported.

Datatype Limitations
 
  • Datatype checking conforms to underlying Java types, not necessarily to schema rules:
Schema type  Java type 
boolean  Boolean 
integer  Integer 
decimal  BigDecimal 
float  float 
double  double 
  • The NMTOKEN, NMTOKENS, Name, NCName, ID, IDREF, ENTITY, ENTITIES, NOTATION are only supported on attributes. At the moment they cannot be applied to element content.
  • The recurringInstant, date, time, and language datatypes are not supported.
  • Datatype qualifiers on attributes are not supported.

Other Limitations
 

The schema is specified by the first xmlns attribute on the root element of the document. There must be an attribute declaration for this xmlns attribute.


Usage
 

In this release, schema validation has been integrated with the regular SAXParser and DOMParser classes. No special classes are required to parse documents that use a schema.

Documents that use XML Schema grammars specify the location of the grammar using an xmlns attribute attached to the root / top-level element in the document. Here is an example:

<document xmlns="document.xsd">
...
</document>

Another requirement is that the XML Schema document's grammar must have a <!DOCTYPE ...> line specifying the DTD for XML Schema grammar. The DOCTYPE must specify the following system identifier:

http://www.w3.org/TR/1999/WD-xmlschema-1-19991217/structures.dtd

Also, there must be an attribute declaration for the xmlns attribute used to find the schema (document in the example above).

Review the sample file, "data/personal.xsd" for an example of an XML Schema grammar.