XSLFilter Configuration
To configure an XSLFilter
you must create a
.properties
file for it. It may contain the
following property settings:
$class
-
This property must be set to
com.escenic.syndication.xml.filter.XSLFilter
. filter
-
This must specify the relative paths of one or more XSL transformations to be run on the input data, separated by commas. The transformations are run in sequence: output from one transformation is piped into the following transformation. For example:
filter=./transformation1.xsl,./transformation2.xsl
cacheFilter
-
If set to
false
, then XSL transformations are not cached, but reloaded every time they are used. The default setting istrue
: transformations are only loaded once and cached for future use. It can be useful to setcacheFilter
tofalse
during development, so that changes to the transformations are used without needing to explicitly reload them.
If, for example, you have created a transformation called
iptc.xsl
for converting the XML output by
IPTCStreamFilter
to syndication format, then to
make use of the transformation, you could create an
XSLFilter
configuration called
IPTCFilter.properties
with the following content:
$class=com.escenic.syndication.xml.filter.XSLFilter filter=./iptc.xsl
Given the example folder structure described in
Creating Import Tasks, if you wanted
to use the filter for the publication pub1
then you
would place the file in
configuration-root/import
/pub1
/filters
,
and set SAXFilters.jpg
in
configuration-root/import
/pub1
/ImportConfiguration.properties
as follows:
SAXFilters.jpg=./filter/IPTCFilter
or (if you need to be able to see the input and output for debugging purposes):
SAXFilters.jpg=./filter/DebugFilter,./filter/IPTCFilter,./filter/DebugFilter
You will find a sample XSLFilter
properties file
called XSLFilter.properties
in the
/engine/contrib/import/filter
folder.