syntax

result = TRANSFORM (FACS database, stylesheet, file name)

Arguments

FACS database: FACS database name

result, stylesheet, file name: text

Meaning

With the TRANSFORM function you can transform a Collections record by means of your own XSLT stylesheet, from the Adlib XML format to every other desired document format. As arguments to the function, you include a FACS database, the name of the stylesheet and optionally a (relative path plus) file name into which the result is saved as a file. (If you provide a file name, also add the proper extension of the format into which you are transforming the record, e.g. .htm or .txt.) The record to be transformed must already have been read (via READ) from the relevant, opened FACS database.
This way, you can transform a record to plain text, for example, or to an HTML page, to be sent by e-mail or for display in an internet browser.

A FACS database name is an alias for a database table, which is defined in the current adapl. To be able to use a record from this database in this function, that database must have been opened earlier in the adapl (with the OPEN function) and the desired record must have been read (with the READ function). The FACS database name must be entered without quotes.
Via your own XSLT stylesheet you specify the transformation that has to be performed. Adlib XML is structured according to the adlibXML.xsd (an XML Schema Definition). The most important thing you need to know about this is that only the XML tags of the three highest levels have been specified, namely: adlibXML (root tag), recordlist (may occur only once), record (may occur indefinitly). Further, there is a diagnostic tag on the level of the recordlist, which contains metadata. The structure of a Collections record itself is not defined in the schema definition because this differs per database. It’s easy though, to obtain an example of Adlib XML, by exporting a few marked records to an XML file from your Collections application.
In this function, you enter the stylesheet via its full file name, including the extension (.xsl or .xslt) enclosed by single quotes.
If you provide a file name (which is optional), enclose it by single quotes.

Example 1

result = transform (COLLECT, 'AdlibXML-toHTML.xsl')
sendmail (‘me@axiell.com’, ‘you@museum.com’, ‘’, ‘new records’, result, ‘’, 1)

Result

First, the record currently read from FACS database COLLECT is transformed from XML to HTML via a stylesheet created for this purpose especially. This HTML page is stored temporarily in the result variable. Then, an e-mail is sent, with the contents of result as message body text. The argument 1 indicates that the body text must be interpreted as HTML, not as plain text.