Export and import formats
In Collections, custom export formats are XSLT stylesheets (optionally combined with an adapl) with which you generate an exchange file from selected records, in a format that is completely up to you, while custom import formats are XSLT stylesheets (no combination with adapl possible) with which you can import an exchange file in grouped or unstructured AdlibXML* format.
For creating any type of exchange file via a Collections custom export format, simple or complex, an XSLT stylesheet must be put to use.
XSLT (Extensible Stylesheet Language Transformations) is a standardized language (an XML variant) for converting an XML document to a differently structured XML document or to a document in another format, for instance an HTML or text document. Moreover, XSLT has programming language characteristics like constants and functions.
Collections stores records as XML in AdlibXML format and when you execute an XSLT export format, this XML is passed on to the stylesheet which converts the XML to the desired format: this target format can be any desired format (XML, HTML, CSV, plain text, etc.) if it concerns an export format. Which XML type (unstructured or grouped) must be generated by Axiell Collections, can be set per XSLT Export format in the XML type option.
Similarly, to
import some non-AdlibXML XML file into Collections, it must first be transformed to grouped or unstructured AdlibXML by a custom XSLT stylesheet.
When export formats have been specified in the application setup for a data source, an Xslt option will be visible in the Format drop-down in the Export dialog; when selected, a Style Sheet drop-down will display to the right, from which the desired custom export format stylesheet can be selected.
And when import formats have been specified in the application setup for a data source, a Style Sheet drop-down will become visible underneath the Format drop-down in the Import dialog, from which the desired custom import format stylesheet can be selected, as soon as you select an XML type (grouped or unstructured) in the mentioned Format drop-down for which an import format was indeed set up.
Note that although in Designer these export and import formats are confusingly also referenced as export jobs and import jobs (in the right-click pop-up menu for a data source and in the properties tab titles for these formats), these must not be confused with export and import jobs which consist of the properties of an actual export or import procedure that can be run from within the ExportTool/ImportTool or the Export job editor or Import job editor in Designer...
* Collections XML is formatted according to the adlibXML.xsd (an XML Schema Definition). The most important thing you need to know about that XML format is that only the XML tags of the three highest levels have been defined, namely: adlibXML (root tag), recordlist (may occur only once), record (may occur indefinitly). The structure of a Collections record itself is not defined in the schema definition because this differs per database table and XML type. It's easy though, to obtain an example of the generated XML, by exporting a few marked records to an Unstructured or Grouped XML file from your Collections application, using the default export formats. The main advantage of the grouped type over the unstructured one is that it becomes easier to process repeated occurrences of grouped fields. In unstructured XML, all fields and field occurrences are just listed in one long list inside the <record> node, whilst in grouped XML, fields are grouped within a field group node (if a relevant field group exists in the data dictionary) and that field group node is repeated for each field group occurrence. Whenever you create an XSLT stylesheet for unstructured XML, which must be able to collect field data per field group occurrence, you have no choice but to always count the “position” of every processed field occurrence because that’s the only way to retrieve the other fields from the same position. In grouped XML on the other hand, there’s no need for such a workaround because every field group occurrence is contained within its own field group node. Matching an XSLT template to a field group node automatically provides access to all grouped fields with the same occurrence number (in other words: at the same position).
More information about using XSLT for Axiell Collections can be found in the separate Programming XSLT stylesheets for Axiell Collections document.
See also

