afs_xml_xslt - AFS - Reference Guides

AFS Filters Description

Product
AFS
Platform
7.12
Category
Reference Guides
Language
English

The xsl transformation filter allows to perform XSL transformations.

The filter is declared with the afs_xml_xslt type. It is in the antidot-paf-misc package. It is a processor filter.

This filter can be instantiated only once at any given moment. It will not read the "instances" parameter in the configuration.

The XSL Transformation filter specifications are described in the following table:

Parameter name

Mandatory

Type

Default

Description

xsl_file

Yes

file

N/A

It is the path of the XSL file.

input_layer

No

layer

CONTENTS

It is the input layer.

output_layer

No

layer

CONTENTS

It is the output layer.

params

No

map

Empty map

It gives the global variables to the XSL processor.

xml_catalogs

No

file_list

N/A

If the use of a specific validation catalog is needed (catalog not present in /usr/local/afs7/share/xml), use this parameter to load it.

The following lines show an example of the XSL transformation filter:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:afs="http://ref.antidot.net/v7/afs#"
    extension-element-prefixes="afs">

    <xsl:output encoding="UTF-8" indent="yes" method="xml"/>

    <xsl:template match="/*">
        <test>
        <xsl:copy-of select="afs:xml-layer('CONTENTS')"/>
        </test>
    </xsl:template>
    
</xsl:stylesheet>

A default AFS catalog is bundled in /usr/local/afs7/share/xml. It contains several XSD and Links that can be used without network request.

Tip: afs_xml_xslt filter does not access the Internet. Any use of an external link that cannot be resolved thanks to an offline catalog will result in an error message. This error is visible in the filter log, with a log level of 2. Depending on the DTD semantic, this error can be ignored or fail the transform.
Note: The EXSLT (||http://www.exslt.org/) extensions are available.
Note: The afs:xml-layer(string) : string extension is available to allow access to the layers of the current document in process.
Note: For more information about crating an offline validation catalog and its specifications, see Create a catalog (http://www.xmlsoft.org/xmlcatalog_man.html) and Catalogs specs (http://www.oasis-open.org/committees/entity/spec-2001-08-06.html).