Open topic with navigation

# XSLT in IDOL

XSLT (Extensible Stylesheet Language Transformations), is a language for transforming XML documents. XSLT is commonly used to render XML in a human-friendly format (for example HTML), to transform XML into a different type of XML for input (for example, RSS), or even to generate a non-XML format like CSV (comma-separated values) for import into an application like Microsoft Excel. XSLT transforms XML documents using XSLT templates, which are themselves written in XML.

The IDOL native API is a REST-style Web service called the ACI (Autonomy Content Infrastructure) API. The default response format is XML, with an IDOL-specific schema. All IDOL ACI services have the built-in capability to perform server-side XSLT transformations.

NOTE:

ACI Servers support only XSLT version 1.0.

TIP:

The IDOL Admin user interface allows you to perform many administrative actions in IDOL without setting up your own XSLT templates. Before you start to use XSLT, check whether the IDOL Admin interface contains the functionality you need for your services. For more information, refer to the IDOL Admin User Guide.

## Advantages of XSLT in IDOL

The most obvious benefit of using XSLT templates in IDOL is that rendering verbose XML output in a more human-friendly format such as HTML can significantly simplify user interaction. It allows you to filter, restructure, and format the information. You can also embed dynamic links into the rendered HTML to make it easy to issue companion actions (for example, to revoke a license seat after viewing license status). In fact, you can write reasonably complex front-end interfaces to IDOL exclusively using XSLT.

Another advantage of using XSLT is that it avoids the complexity and overhead of custom code in Java, .NET, Python, and so on. This can greatly speed up development time, particularly for one-time tools and prototypes.

XSLT does not need to generate HTML.

IDOL supports the OpenSearch XML standard. Both IDOL and OpenSearch are based on REST-style Web services, and it is simple to use IDOL XSLT to transform IDOL responses into OpenSearch-compliant XML responses.

You can use XSLT templates to convert IDOL statistics into CSV files, which can be imported into charting and analysis tools such as Excel.

Other potential XSLT uses include charting information directly by converting XML output to the SVG format, or converting to the XSL-FO format to generate PDF reports.

## Use XSLT in IDOL

To set up XSLT with an IDOL ACI service, you need to deploy the `autnxslt` library file in the same directory as the ACI service executable.

NOTE:

The specific name of the library file varies according to your platform.

You must also configure the following parameters to enable XSLT in the service:

    [Server]
    XSLTemplates=True

    [Paths]
    TemplateDirectory=PathToXSLTTemplates

When the ACI service starts up, the service logs the following message in the application.log:

    ACI Server is configured for XSLT templating

All subsequent ACI actions support the `Template` action parameter, which allows you to add an appropriate template, as needed, for each action. For example:

    action=GetStatus&Template=GetStatusForm

The template must be in the directory that you specify in the `TemplateDirectory` configuration parameter. You do not need to add the .tmpl extension to the template name in the `Template` parameter.

TIP:

You can also optionally add the `ForceTemplateRefresh` parameter to an action to force the ACI service to reload the latest version of the XSLT template file from disk, rather than from the cache. This parameter is useful during configuration and testing of the XSLT.

## Standard Templates

The standard IDOL installer includes a number of templates for IDOL Server actions such as `GetStatus`, `IndexerGetStatus`, `MemoryReport`, `Query`, `GetContent`, and `Suggest`.

The following examples show the `GetStatus` XML output (left) and the output from the `GetStatus` form (right):

© 2018 EntIT Software LLC, a Micro Focus company | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm