XML Page

Schema Component Designators

Here is a little program that takes in XML Schemas and spits out short-form schema component paths for the canonical paths to components in the schema.

Installation

This program requires Xerces-J 2.6.2. If you use the -a flag to get annotation paths as well, you need the a version built from source control that fixes a null pointer exception. For convenience, I have a link to the built binaries here.

Download these jar files and put them in your class path: mhscd_01.jar and the built-from-CVS xerces262.jar.

Usage

java com.mathling.scd.SCDGenerator [-a] [-s] uri...
-a
Generate paths for annotations. You must build from the latest CVS source for this to work.
-s
Generate paths for components in the XML Schema namespace.
uri...
URIs of the schemas to process.

Example:

>java com.mathling.scd.SCDGenerator http://dublincore.org/schemas/xmls/simpledc20021212.xsd
/
/@p:base
/@p:lang
/@p:space
/@p:space/~0
/@p:space/~0/facet::enumeration
/p:relation
/p:source
/p:type
/p:coverage
/p:rights
/p:contributor
/p:title
/p:date
/p:identifier
/p:subject
/p:format
/p:creator
/p:publisher
/p:description
/p:language
/group::p:elementsGroup
/group::p:elementsGroup/model::sequence
/group::p:elementsGroup/model::sequence/model::choice
/attributeGroup::p:specialAttrs
/attributeGroup::p:specialAttrs/@p:base
/attributeGroup::p:specialAttrs/@p:lang
/attributeGroup::p:specialAttrs/@p:space
/attributeGroup::p:specialAttrs/@p:space/~0
/attributeGroup::p:specialAttrs/@p:space/~0/facet::enumeration
/~p:elementType
/~p:elementType/@p:lang

You can use this as a quick way of getting a sense of what it in a schema. I have also found that it can be a handy way to isolate differences in related schemas.

This is definitely a work-in-progress, buggy, subject to change and improvement without notice. Play with it, but don't bet the farm on it.