Versions Compared

Key

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

...

This is additional Eclipse configuration - particularly to get XML aspects of Eclipse working reasonably.

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: 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/target/eclipse/classes/daffodil-built-in-catalog.xml. Click OK.

Setup XML Validation Settings

In Eclipse:

Select Window -> Preferences

...

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

Associate TDML Files With The XML Editor

In Eclipse:

Window -> Preferences -> General -> Content Types

...

Click 'Add'.  Select "Text Editor".  Click OK.

Click OK.

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

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

Setup Unix-Style Line Endings

In Eclipse:

  1. Go to Window -> Preferences -> General -> Workspace
  2. In the bottom right of the window you'll see 'New text file line delimiter'.
  3. Select 'Other'.
  4. In the drop-down, select 'Unix'.
  5. Click Apply.
  6. Click OK.

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 System and Settings -> 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.