Tech. Note 5: Filter Plugins
Filter Plugin examples information
- XML Sort and Normalize format Example with Saxon
Website: http://saxon.sourceforge.net/
Notes: Saxon is a Java-based, cross platform tool. Saxon with an XSLT can be used to sort and normalize
the format of XML files. Here's the .xslt file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<!-- Sort the attributes by name. -->
<xsl:for-each select="@*">
<xsl:sort select="name( . )"/>
<xsl:copy/>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()|comment()|processing-instruction()">
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>
- DOC Extract to XHTML Example with Tika
Website: http://tika.apache.org/
Notes: Tika is a Java-based, cross platform tool. Tika writes its results to stdout - so,
the ${OUTPUTPATH} keyword is not needed in the arguments. The Tika command line utility is
documented at the end of "Getting Started" on the website.
- PDF Extract text Example with PDFBox
Website: http://pdfbox.apache.org/
Notes: PDFBox is a Java-based, cross platform tool. See the ExtractText command line utility on
the website.
- Spreadsheet Extract to XHTML Example with Tika
Website: http://tika.apache.org/
Notes: Tika is a Java-based, cross platform tool. Tika writes its results to stdout - so,
the ${OUTPUTPATH} keyword is not needed in the arguments. The Tika command line utility is
documented at the end of "Getting Started" on the website.
- Java Normalize format Example with Jalopy
Website: http://jalopy.sourceforge.net/
Notes: Jalopy is a Java-based, cross platform tool. The console plugin (command line interface)
download is at:
http://sourceforge.net/projects/jalopy/files/plugin%20console/
Jalopy writes its results to the input
file (replaces it). So, we used a script file to backup, rename, etc. the files. Here's the
.bat file:
copy %1 %1.bak
set CLASSPATH=C:\MyTools\Jalopy\jalopy-console-0.1-1.5rc3\lib\jalopy-console.jar;C:\MyTools\Jalopy\jalopy-console-0.1-1.5rc3\lib\jalopy.jar;C:\MyTools\Jalopy\jalopy-console-0.1-1.5rc3\lib\getopt.jar;C:\MyTools\Jalopy\jalopy-console-0.1-1.5rc3\lib\log4j.jar
java Jalopy -c c:\MyTools\Jalopy\MyJalopySettings.xml %1
copy %1 %2
copy %1.bak %1
del %1.bak
- C, C++ Normalize format Example with Uncrustify
Website: http://uncrustify.sourceforge.net/
Notes: Uncrustify is a source code beautifier tool. It's cross-platform and is known to work on Windows,
MacOS X, and Linux. But, a pre-built binary is only available for Windows.
- HTML Normalize format Example with JTidy
Website: http://jtidy.sourceforge.net/
Notes: JTidy is a Java-based, cross platform tool. JTidy writes its results to stdout - so,
the ${OUTPUTPATH} keyword is not needed in the arguments.
User Filter Plugins favorites
If you have a favorite tool you're using as a Filter Plugin with Guiffy, send us an email at
with the information
needed and we'll share it with everyone else here.
Filter Plugins debugging information
First we recommend testing the plugin tool standalone. Then, build or edit the Filter Plugin definition for
integration with Guiffy.
The plugin process writes (appends) its stdout (if stdout is not the result output of the tool) and stderr
to the file FilterTrace.txt in the Guiffy configuration folder.
To see debug information while Guiffy builds the plugin command line for execution, create an empty file,
FilterDebug.txt, in the Guiffy configuration folder. This file is appended each time a filter plugin is executed.
Guiffy's normal Debug Trace (See Tech Note 1) may also produce output helpful while debugging a Filter Plugin.
Documentation by
Guiffy Software, Inc. 2012