Target audience: jInfer users. Anyone who needs to use jInfer to create DTD, XSD or another schema from existing XML documents, schemas (again: DTD, XSD, ...) or queries (such as XPath).

Note: we use the term inference for the act of creation of schema throughout this and other jInfer documents.


  1. Get & install NetBeans.
  2. Get & install jInfer.
  3. Infer schema.


Do this if you don't have any NetBeans installed. If you have an older version than 6.9, jInfer will not run - please update it first.

  1. Go to http://netbeans.org/.
  2. Download NetBeans 6.9+, whichever bundle will do.
  3. Follow installation instructions.


Do this if you have the correct version of NetBeans installed. Note that jInfer features automatic update - you don't need to follow these steps each time new version comes out.

  1. Go to https://sourceforge.net/projects/jinfer/files/.
  2. Download the latest jInfer binaries (jInfer-X.Y-bin.zip).
  3. Unpack the ZIP, you'll get a few NBM files.
  4. Start NetBeans, open Tools > Plugins from the main menu.
  5. Switch to Downloaded tab.
  6. Click Add Plugins....
  7. Select all the unpacked NBM files.
  8. Click Install and follow the instructions.
  9. Restart NetBeans.

Basic Inference

This section assumes you have NetBeans and jInfer installed. After the first run, a jInfer Welcome window will appear, guiding you through basically the same steps that will be covered here. You might want to follow them instead.

Let's assume that you have one or more XML files, and you want to create XSD schema from them.

  1. Create a new jInfer project.
    1. File > New Project or New Project icon from the toolbar or right-click the area in Projects window > New Project.
    2. Select jInfer category, jInfer Project.
    3. Click Next.
    4. Choose a name (for example MyInference) and location of your project.
    5. Click Next.
    6. In the Schema Generator combo box select Basic XSD Exporter.
    7. Click Finish.
  2. Add input XML files to this project.
    1. Right click the newly created project in Projects window.
    2. Select Add files.
    3. Select XML files you want to use for schema inference.
    4. If you now open the XML folder in your project, you will see the added files.
  3. Run inference.
    1. Run Project in the toolbar (green play icon) or right click the project, select Run.
    2. Generated schema will open in a new Editor window. It will also appear in the Output folder.
    3. You will find the file with the schema in your project (location from step 1d, folder output).

Project files

This section assumes you have successfully inferred at least one schema.

Setting up jInfer

This section assumes that you have successfully inferred at least one schema and know how to manipulate input and output files in a project.

To change jInfer settings, you have to first realize whether it is a change affecting a single project at a time (for example, changing the output language from XSD to DTD) or whole jInfer at once (whether schema should open in Editor window after the inference finishes).

  1. First type of settings is found in so called Project Preferences. You can access them from the respective jInfer project's context menu: right click the project and select Properties.
  2. Second type is called jInfer Options and can be found among NetBeans' options: open them (Windows, Linux: Tools > Preferences..., Mac: NetBeans > Preferences...) and switch to jInfer tab.

Interactive simplification

This section assumes that you have successfully inferred a few schemas and would like to play with the process, interfere with it.

Default simplifier that jInfer uses is non-interactive: after it is run, it will work for a while and then display the generated schema. However, jInfer bundles also a way to guide the inference process interactively, by selecting states in an automaton that should be merged together and selecting which state should be removed while converting an automaton to a regular expression. For more information on this, see the documentation of TwoStep simplifier. To try out interactive inference, do the following with your jInfer project:

  1. Open Project Preferences.
  2. Navigate to Simplifiers > TwoStep > Automaton Merging State.
  3. In the Automaton simplifier combobox select User Interactive.
  4. Navigate to State Removal.
  5. In the State Removal orderer combobox select User Interactive.
  6. Save the preferences by clicking OK.
  7. Run the inference again.
  8. A new window will appear, which will require you to select states to be merged in each step of simplification. After selecting these states, proceed by clicking Continue.