Skip to main content
Skip table of contents

Customize text previews with XSLT

How to customize text previews for the censhare Client.

Introduction

XML text assets can be constructed by transforming them into an HTML format. The client can display text, images and tables.
Choosing the appropriate XSLT (transformation-asset) works as follows:

  • first found asset with production flag "output template text-preview" which is user related to the input template.

  • first found asset with production flag "output template text-preview" (unrelated to any input template)

For each of the found possible transformation assets, the configured source asset filter will be checked and the first match is used. Otherwise, the search continues with the other possible candidates.

XSLT transformation assets themselves are shown as pure code by embedding them in an HTML template. This allows searching for code fragments using the full-text search.

Example

The text preview is now well readable and also the structured text form is visible. Thus, embedded images or tables can also be shown in the preview.

For the text previews of XML files, tags can be hidden or only certain types are shown which makes the content clearer and easier to understand.

Configuration

The standard for XML is an already preconfigured "transformation asset." 

Configuration in Modules · Previews · Text Preview Preferences

A customer-specific resource asset is necessary and contains the transformation rules as XSLT, see the image below.

Customer-specific resource asset

To use different transformations for various XML texts, the field 'Source Asset filter' has to be filled in accordingly, see picture below.

Source asset filter to use different transformations

Find a sample asset called 'simple-xml2htm.xsl' in the censhare Tracker under Asset ID 2268112.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.