Xsd Reducer

Simplify and reduce the size of the Xsd by deleting the unused declarations from it

Sometimes the Xsds hold much more declarations (simpletypes, complexTypes, elements), than needed to our application. In order to simplify the Xsd, first we have to define the declarations those necessary for our application. After that we have to find every declarations those used (directly and indirectly) by the necessary declarations. The remaining part of the xsd could be deleted. This tool does this work. It parses the Xsds, determines which parts of the Xsd are in used, and remove the unused, unnecessary part of it.

Example

Assume we use only the MyRequest type from the example xsd. It indirectly uses the MyContentType, but the remaining types in the xsd are unnecessary. The XsdReducer removed the unnecessary parts:

Download

XsdReducer

How to use

This tool has a CommandLine and a Gui mode.

GuiMode

  1. Starting:
    java -cp XsdReducer.jar;lib\xsom-20081112.jar;lib\jaxb1-impl.jar xsdreducer.XsdReducer
  2. Choose a source folder, where the Xsds are located!
  3. Choose a target folder, where the reduced Xsds will be written to!
  4. Select a namespace!
  5. Select the types, those you use directly!
  6. Repeat from 4. for all namespace!
  7. Push the "ReduceXsd" button!
  8. You can find the reduced xsds (witch contains only the essential types) in the target folder.

CommandLineMode

  1. Edit the useddecl.property file! Add the directly used types to it!
  2. Start the tool:
    java -cp XsdReducer.jar;lib\xsom-20081112.jar;lib\jaxb1-impl.jar xsdreducer.XsdReducer -sourceDir -targetDir -property -verbose
  3. You can find the reduced xsds (witch contains only the essential types) in the target folder.

  feedback: