Transforms
Analyse | Transforms
(Requires Transform record types. Not fully implemented yet. )
The Transforms tab is visible only when transform objects are available in the records.
The Transforms tab lets you to transform your input data to structured output for tailored structured views of your records by applying additional formatting or processing to the result of a query. Standard transforms can be applied, including:
- Viewing TEI records. Import TEI data and annotate the TEI-marked-up text.
- Viewing Picasa albums. Import images from an external image hosting site (e.g. Picasa web albums) and display the images on-screen.
Advanced users can create new transform templates by creating an XSLT file.
This topic describes:
- About Transforms. Provides an overview of Transforms as used in Heurist.
- Before You Begin. Describes what you need to do first in Heurist before you can start using (or crating) transforms.
- Create XML Record. Describes how to create a record for storing the structured XML document that the transform will act upon.
- Create Transform. Advanced users can create their own transforms and apply these against suitable records.
- Apply Transform. Describe show to select from a number of default Transforms supplied by Heurist or user-created transforms, and apply them against properly structured data.
The Reference topic: Available Transforms, provides information on applying standard Heurist transform types (as other Transforms are made available, these will be self-documenting within the Transform record itself), including:
- TEI Annotation. The Transforms tab will provide advanced formatting functions and tools for annotation of documents marked up according to the TEI (Text Encoding Initiative) standard.
- Image Viewer. Using transforms to create a viewer for Picasa albums.
About Transforms
A transform is essentially a template that identifies a set of patterns in a source document (e.g. 'find all the top level headings') and describes what to do with these elements (e.g. write out all the headings as title elements').
Transforms encompass the following three types of file:
- Input. This is a record of type Document, that stores an XML file containing the structured source data to be transformed. Data is structured through the use of meaningful tags, that identify the different components of the document. You can have multiple XML documents.
- Transform. This is a record of type Transform, that stores / links to an XSLT file containing the output formatting to be applied to the input (source) data. XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other XML documents,[1] or other objects such as HTML for web pages, plain text or into XSL Formatting Objects which can then be converted to PDF, PostScript and PNG. Typically, input documents are XML files. The original document is not changed; rather, a new document is created based on the content of an existing one. Note. A transform is another name for an XSLT or 'XSL Transform'. This is also known as an XSL style sheet. Both terminologies are synonymous and either can be used.
- Output. This is the output produced by the transform on the source data, and can be in various formats, such as XHTML
XML and XSLT files can be produced using any text editor (since they are only text), or a dedicated editor, such as Oxygen or OpenOffice.
Different templates (or transforms) can be applied to the same set of data.
Note. Regular Heurist users do not need to understand more than this high level understanding of XML and XSLT transforms, as standard transforms are supplied as part of the Heurist Extended database structure. You simply need to upload a document to a record , correctly identify the encoding format, then choose a transformation. Advanced user can however, create their own Transforms (see Create Transforms.)
When you create a Document record that links to an XML file, the XML code is wrapped in HML (Heurist Markup Language) code so that it can be acted upon by the XSLT template.
Once you have defined your XML documents, you can run a query that results in the records (i.e. the XML data defined by the Document-type records) been displayed in the Search Results pane. You can then apply the Transform against these records. The input XML file and the transform are combined with the XSLT processor (a standard browser XML processor) and the results are output according to the output formatting defined in the Transform. If the output format is XTHML for example, the data will be displayed in the Search Results pane.
The following diagram shows a sample of XML code to structure data about music CDs, and the matching XSLT code that transforms this data into a simple table for viewing by a human:
Transform Tools
A transform tool is an additional action or functionality applied by a transform. One or more tools may be available, for instance, as buttons on the Transform pane.
Before You Begin
For the Transforms tab to work, it requires a number of record and field types which are not part of the standard core structure inherited by all databases. In order to use the Transforms feature therefore, you need to write (or be given) XSLT files. To use these for transforming XML or annotating TEI-marked-up text, you will require additional record and field types which can be imported from the Heurist Reference Set #3 (go to Manage | Structure | Templates).
Note. If the required record and field types are missing, you will see a message, in red, in the Transforms tab when you try to select a Transform.
Create XML Record
Create your XML file via an external editor (e.g. OpenOffice, oXygen) and store these locally. Create a new record of type Document (see New) and complete the Edit Record screen displays. The minimal information required to create the XML record:
- Title of Document. Enter a suitable name for the XML record.
- File resource. Upload the XML file. For example, a TEI-type document (see TEI Annotations).
- File type. Select XML.
Once you save the record it can be searched and displayed on the search results pane. The corresponding Transform can be applied against the search results (see Apply Transform below.)
Create Transform
Creating a transform requires creating two types of record:
- Transform type record. This applies the XSLT code to the XML records. You have just one Transform record per transform.
- XML type record. This contains the structured data that the Transform records transforms. You can have one or many of these.
For this you will need to understand or know someone who understands the following concepts:
- XML. Extensible Mark-up Language. This is a mark-up language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
- XSL. EXtensible Stylesheet Language. This is a style sheet language for XML documents.
- XSLT. XSL Transformations. This is an XML transformation language designed specifically to transform an input XML document (like XHTML) into an output XML document which satisfies some specific goal.
- XHTML. Extensible HyperText Mark-up Language. This is a family of XML mark-up languages that mirror or extend versions of HTML, the language in which web pages are written.
- TEI. The Text Encoding Initiative (TEI) is a semantic XML format for marking up text.
- HML. Heurist Markup Language.
Note. This help does not cover these standard mark-up languages in any detail but plenty of information is available in the usual places on the web, including examples that you can try out. (See Sources.)
You need to create (register) one Transform type record per transform.
To create a Transform Record, create an XSLT template file via an external editor (e.g. Open Office, oXygen) and store it locally. Create a new record (see New). Select a record type of Transform and click Add Record:
Complete the edit record screen:
- URL. Don't use.
- Title of Document. Enter the name you wish to give the transform (i.e. to appear in the Transforms Tab dropdown).
- Template File. Use this to upload an XSLT file link to it via its URL.
- Transformation type. Select XSLT 1.0. (Future versions of Heurist will allow for different transformation types.)
- Transform. Future. This will be available in a future version of Heurist. This allows you to paste XSLT code directly into the record. Note. Heurist doesn't do any validation of this code unlike an external editor like oXygen. For this reason, it is best to use this feature for short pieces of code or code that has been validated via an external editor.
- Description. Add a useful description so that users of the transform can find out what the transform does, including the type of structured document to be transformed.
For example:
Once you save the record the transform will appear in the Transforms tab dropdown (Refresh if it does not).
Apply Transform
Note. Before you begin you must have access to (or have created) one or more records (of type XML) that point to the appropriate structured XML data source (see Available Transforms).
Search for the target XML records. Select the Transforms tab. Select the appropriate Transform from the dropdown.
Note. The structure of the transform must match the selected XML records.
The record data is now transformed and the results displayed in the Transforms pane.
A range of transforms will be available from the Transforms dropdown as part of the Extended Database.
Note. To find out more about a specific transform you can search on Record Types of Transform and look at its details in the record's description box.
See Available Transforms for details on using the following standard transform:
- Picasa Viewer.
- Annotation.
Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator