The binding definition format has gone through repeated changes during the development of the 1.x releases. Unfortunately, these changes have led to some inconsistencies and inadequacies in the format. The JiBX 2.0 release will implement a revised binding definition format that should be both easier to use and more powerful. Specific planned changes include:
- Create a <template> element as a variation of the current <mapping> element. <template> will be specifically for abstract mappings, while the <mapping> element will be reserved for concrete mappings (including a specific element name).
- Create a <map-as> element as a variation of the current <structure> element. The current <structure> element interpretation is ambiguous in certain cases, when no child elements are present and the map-as attribute is not used. The <map-as> element will replace <structure> in the case where the user intends a <mapping> (or <template>) definition to be used.
- Add an inheritable attribute for the current package used in class references (default-package="...") so that this doesn't need to be present on every binding component.
- Allow namespace references by prefix, rather than requiring the full URI.
- Rationalize the <value> element usage. Right now there are some unusual cases (such as when the user wants to use a <mapping> for an element with only text content) which cannot be handled properly.
- Add a property attribute to the <value> element in order to name a JavaBean-style property (rather than having to use get-method and set-method separately.
It should be possible to use a translator to convert 1.x binding definitions to 2.x binding definitions, though there's likely to be some human intervention required in complex cases.