Mythicsoft Knowledge Base

Full Text Search
»

Custom output format using XSL Transforms

RSS
FileLocator Pro provides the built in export formats:
  • Text
  • Comma Separated (CSV)
  • Tab Separated
  • HTML
  • XML

However, it is possible to completely customize the output format using XSL Transforms. Some sample transforms are provided in the Sample Transforms sub folder of the FileLocator Pro installation directory.

A simple transform to only output the names of files is shown below:

{{{{

<?xml version="1.0"?>
<!-- Full name only Transform
    Copyright (C) Mythicsoft Ltd 2008. All rights reserved.
    
    Produces output that contains just the full path to the file (including the 
    file name), each on a new line.
    -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:rslt="http://www.mythicsoft.com/FileLocator_16Aug2005"
        version="1.0">

  <xsl:output method="text" indent="yes"/>

  <xsl:template match="/">
    <xsl:apply-templates select="//rslt:file"/>
  </xsl:template>

  <xsl:template match="rslt:file">
    <xsl:value-of select="rslt:path"/>
    <xsl:value-of select="rslt:name"/>
    <xsl:text>&#13;&#10;</xsl:text>
  </xsl:template>

</xsl:stylesheet>

}}}}



More information on the FileLocator Pro XML Schema can be found here:

FileLocator Pro XML Schema

And more information on XSLT here: http://www.learn-xslt-tutorial.com/

Mythicsoft KB powered by ScrewTurn Wiki. Some of the icons created by FamFamFam.