Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added section on Eclipse XML Setup

...

Code Block
-clean
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.100.v20110505
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms1000m
-Xmx1250m
-Xss2m

Eclipse XML Setup

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 of interest to this

  • daffodil-lib/eclipse-xml-catalog.xml
  • core/eclipse-settings.zip

The eclipse-xml-catalog is imported into Eclipse via File->Import->XML->XML Catalog.

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

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/.metadata/.settings, 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.

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

For example,

  • Edit core/tests/AA.dfdl.xsd in eclipse. Notice that it does not use xmlns="http://www.w3.org/2001/XMLSchema", which is the usual name space for XML Schema. Rather, it uses "http://www.ogf.org/dfdl/dfdl-1.0/XMLSchemaSubset" which provides much more DFDL-oriented schema validation.
  • 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 should see a validation error.
  • Validation using the DFDL XML Schema Subset URL will validate short form and long form DFDL annotations, and enforce DFDL's subset of XML Schema.

Contrarywise....

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