XSD4J Documentation
Version 0.3
XSD4J is a library to handle XML Schema Definitions (XSD). Using it is very straight-forward, when orienting to the following introduction.
Parsing a file or embedded schema is done via a XSDParser object. The method parseSchemaFile (or parseSchemaElement) returns either a XSDSchema object for further use, or null, in which case the getDebug method can be used to write out the error messages. The access level should be chosen appropriately; they are documented in detail in the XSD4J design document.
In the "flat" access level, a XSDSchema object contains lists of all XSDElement, XSDAttribute and XSDType definitions found in it (and possibly in include files in the "flat-includes" level).
The XSDSchema object presents a tree in the "tree" access level. It can be used like any other XSDSequence object to get the list of all elements via getElements, which in turn provide their XSDType with the getType method. The type is either complex, in which case a new sequence is attached to it and attributes may be found, or simple, so that one starts to check for possible value restrictions.
Since a lot of special types to denote attribute groups or choice elements or even base types need to be considered when working with the XSDSchema, the "merged" mode makes work easier by merging in all referenced elements and attributes.
The XSDDumper class finally is available to rebuild the XML which describes the schema, and print it out somewhere. Similarly, XSDInstantiator, XSDTransformer and XSDValidator can further process XSDSchema objects.
Additional information about XSD4J can be found on its home page: http://dynvocation.selfip.net/xsd4j/
Generated on Thu Sep 13 16:59:12 2007 for XSD4J by
1.5.1