Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated XML Settings. No longer need to overwrite users settings.

...

Getting eclipse to validate DFDL Schemas using its XML validation capabilities requires some configuration. Without this you will get hundreds (at least) of XML and XML Schema validation errors from the daffodil code base.

There are two files is a single file of interest to this located in your dfdl git repository:

  • daffodil-lib/src/main/resources/eclipsedaffodil-built-xmlin-catalog.xmldaffodil-core/src/main/resources/eclipse-settings.zip

IMPORTANT:  These settings and catalog will change the configuration of eclipse substantially, and may not be suitable for projects other than Daffodil, so save your existing eclipse install directory and workspace's .metadata/.plugins/org.eclipse.core.runtime/.settings directory, if you are trying to share it across more than just Daffodil. You'll likely need to split out into two distinct workspaces and two distinct copies of eclipseEclipse.

Import XML Catalog

  1. Open Eclipse.
  2. Select File -> Import -> XML -> XML Catalog.
  3. Browse to and select daffodil-lib/src/main/resources/eclipsedaffodil-built-xmlin-catalog.xml. Click OK.
  4. Close Eclipse.

Import Eclipse Settings: Windows

  1. Open Windows Explorer and open the folder of your local dfdl git repository.
  2. Navigate to the following file: daffodil-core/src/main/resources/eclipse-settings.zip
  3. Copy this file.
  4. Navigate to the location of your Eclipse workspace.

The eclipse settings zip file contains a .settings directory to be restored in your Eclipse workspace's ".metadata/.plugins/org.eclipse.core.runtime/.settings" directory.

To accomplish this:

  1. Navigate to ".metadata/.plugins/org.eclipse.core.runtime/".
  2. Here, paste the eclipse-settings.zip file.
  3. Right-click eclipse-settings.zip ->  7 Zip -> Extract Here
  4. You may be asked if you'd like to replace the files.  Select yes to all.

Import Eclipse Settings: Linux

Open a Terminal and cd to your local dfdl git repository.  Likely "/home/username/git/dfdl" or "~/git/dfdl".

Code Block
languagebash
titleTerminal
$ cd ~/git/dfdl
$ cp daffodil-core/src/main/resources/eclipse_settings.zip ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/
$ cd ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/
$ ls -la

The above commands essentially copy the eclipse_settings.zip file to the "org.eclipse.core.runtime" folder of your workspace.

The 'ls -la' command should show you that "org.eclipse.core.runtime" contains the zip file and a hidden ".settings" folder.

Now we need to unzip the file and replace the contents of the ".settings" folder.

Code Block
languagebash
titleTerminal
$ unzip eclipse_settings.zip

You will be asked if you want to replace.  Enter "A".  This will replace all of the files.

...

Setup XML Validation Settings

In Eclipse:

Select Window -> Preferences

Select Validation. Verify that the following are NOT checked at all: DTD Validator, HTML Syntax Validator, XML Schema Validator.

Your selections should look similar to the following:

Image Added

Click the "..." button next to XML Validator.  The following window should pop-up:

Image Added

  1. Select the first "Include Group".  Then click "Add Rule". A Rule Wizard will pop-up.
  2. The "File extension" radio button should be selected.  Click Next.
  3. In the next screen type "tdml" (without quotes) into the text field. Click Finish.
  4. Repeat this process in order to add 'dfdl.xsd' and 'dfdl.xml'.

 

  1. Select "Exclude Group".  Click "Add Rule".  The Rule Wizard will pop-up.
  2. Select the "Folder or file name" radio button.  Click Next.
  3. In the next screen, type "target" (without quotes) into the text field.
  4. Check the "Is the comparison case sensitive?" check box. Click Finish.
  5. Repeat this process in order to add 'doc'.

 

  1. Select "Add Include Group".  Then click "Add Rule".  A Rule Wizard will pop-up.
  2. Select the "Folder or file name" radio button.  Click Next.
  3. In the next screen, type "resources" (without quotes) into the text field.
  4. Check the "Is the comparison case sensitive?' check box. Click Finish.

Your "Validation Filters for XML Validator" window should now look similar to the one pictured above.

Click OK.

You should now be back at the "Validation" screen.  Click Apply.  Click OK.

Test It Out

With the settings and XML Catalog above, you can edit DFDL Schemas, and get support from Eclipse.

...