Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contents

Table of Contents
excludeContents

Setup XML

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.

...

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 eclipse.

Import XML Catalog

  1. Open Eclipse.
  2. Select File -> Import -> XML -> XML Catalog.
  3. Browse to and select daffodil-lib/src/main/resources/eclipse-xml-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.

...

  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".

...

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

Close the Terminal.

Test It Out

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

...

  • Edit core/tests/AH.dfdl.xsd in eclipse. Notice that it uses xmlns="http://www.w3.org/2001/XMLSchema", which is the usual name space for XML Schema. 
  • Note that the file extension ".dfdl.xsd" is the standard way to identify a DFDL schema file.
  • Change one of the dfdl:inputValueCalc properties and misspell the property name. Save the file and you will NOT see any validation error.
  • Change one of the attributes of the dfdl:defineVariable element, such as remove the name attribute and put in a ref="foo" attribute. Save, and you should see a validation error.
  • Validation using the standard XML Schema URL will NOT validate short form DFDL annotations, nor will it care if you put a long form annotation element named dfdl:foobar. But if you do get the name of a DFDL annotation element correct, then it will validate the properties on that annotation element.

Setup Linked Resources

Open Eclipse.

You need to describe where you cloned the daffodil repository.  To do so, perform the following:

  1. Go to Window -> Preferences -> General -> Workspace -> Linked Resources
  2. Under 'Defined path variables', click 'New...'
  3. Enter DAFFODIL_ROOT as the Name
  4. Enter the path to the daffodil repository in Location
  5. Click OK twice.

Unicode Setup

Windows

A US install normally doesn't default to a Unicode friendly environment.  One of the features of the Scala programming language is that it is completely unicode aware.

...

  1. From the Windows Start Menu, click Control Panel.
  2. In the Control Panel select Windows Update.
  3. Here you will want to make sure to show all hidden updates as you will need to install one of them if you haven't already.
  4. Choose the Japanese language pack.  Install it.  Reboot

Linux

On Linux, UTF-8 and good unicode fonts are the default. Nothing to do here.