|
Schema Component DesignatorsHere 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 and an inverse program that takes simple paths and locates the corresponding compoment and prints some metadata about it. InstallationThis program uses Xerces-J schema component API. Download these jar files and put them in your class path: mhscd_03.jar and (for convenience) xercesImpl291.jar. Changes from previous version
Earlier changes
LimitationsThe locator only understands a subset of legal paths. In particular it does not currently understand all paths that refer to more than one component. It does not understand many non-canonical path abbreviations. Usagejava com.mathling.scd.SCDGenerator [-a] [-s] [f] [-l N] [-ns prefix=uri]* uri*
java com.mathling.scd.SCDLocator [-p path]* [-ns prefix=uri]* uri*
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. The output of SCDGenerator can be the input to SCDLocator. 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. I expect to expand and improve SCDLocator with a more general locator framework that understands the full range of paths in the current SCDs draft. Licensing and CopyrightCopyright 2005-2010 Mary Holstege.
Previous versionsVersion 1 is available here: mhscd_01.jar using the built-from-CVS xerces262.jar. Version 2 is available here: mhscd_02.jar. |