This is additional Eclipse configuration - particularly to get XML aspects of Eclipse working reasonably.
|Table of Contents|
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
- Open Eclipse.
- Select File -> Import -> XML -> XML Catalog.
- Browse to and select daffodil-lib/target/eclipse/classes/daffodil-built-in-catalog.xml. Click OK.
Setup XML Validation Settings
Select Window -> Preferences
You should now be back at the "Validation" screen. Click Apply. Click OK.
Associate TDML Files With The XML Editor
Window -> Preferences -> General -> Content Types
Click 'Add'. Select "Text Editor". 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
You need to describe where you cloned the daffodil repository. To do so, perform the following:
- Go to Window -> Preferences -> General -> Workspace -> Linked Resources
- Under 'Defined path variables', click 'New...'
- Enter DAFFODIL_ROOT as the Name
- Enter the path to the daffodil repository in Location
- Click OK twice.
Setup Unix-Style Line Endings
- Go to Window -> Preferences -> General -> Workspace
- In the bottom right of the window you'll see 'New text file line delimiter'.
- Select 'Other'.
- In the drop-down, select 'Unix'.
- Click Apply.
- Click OK.
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.
- From the Windows Start Menu, click Control Panel.
- In the Control Panel select System and Settings -> Windows Update.
- 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.
- Choose the Japanese language pack. Install it. Reboot
On Linux, UTF-8 and good unicode fonts are the default. Nothing to do here.