My initial attempts at using Kernow 1.6.1 and the LexEv reader have failed using java version "1.6.0_07".
 
I am attempting to run a stylesheet that converts XSL 1.0 to XSL 2.0.  I am wanting to preserve the <!DOCTYPE> and entities of my XSL source files.
 
I have enabled LexEv via the Kernow options.  All checkboxes are marked and namespace remains blank.
 
I changed the allowed input suffixes for directory operations to ".xsl"
 
Attempting a Single File Transform of a source file containing <!DOCTYPE> and entities displays in the output window transformed but without the <!DOCTYPE> and entities have been expanded.  This is the same result I get from a basic SAXON transformation.  The LexEv reader does not seem to be enabled.
 
Attempting a Directory transformation of a parent directory, I get the following exception:
 
java.util.concurrent.ExecutionException: java.lang.NullPointerException
 at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
 at java.util.concurrent.FutureTask.get(FutureTask.java:83)
 at net.sf.kernow.transform.DirectoryTransformer.runDirectoryTransform(DirectoryTransformer.java:160)
 at net.sf.kernow.transform.TransformControllerImpl.runDirectoryTransform(TransformControllerImpl.java:158)
 at net.sf.kernow.ui.TabDirectory$5.doInBackground(TabDirectory.java:272)
 at javax.swing.SwingWorker$1.call(SwingWorker.java:278)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at javax.swing.SwingWorker.run(SwingWorker.java:317)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
 at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
 at net.sf.saxon.value.Whitespace.removeLeadingWhitespace(Whitespace.java:119)
 at net.sf.saxon.event.ReceivingContentHandler.processingInstruction(ReceivingContentHandler.java:515)
 at org.xml.sax.helpers.XMLFilterImpl.processingInstruction(XMLFilterImpl.java:599)
 at com.andrewjwelch.lexev.LexEv.startDTD(LexEv.java:128)
 at org.apache.xerces.parsers.AbstractSAXParser.doctypeDecl(Unknown Source)
 at org.apache.xerces.impl.dtd.XMLDTDValidator.doctypeDecl(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentScannerImpl.scanDoctypeDecl(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
 at com.andrewjwelch.lexev.LexEv.parse(LexEv.java:117)
 at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:350)
 at com.andrewjwelch.lexev.LexEv.parse(LexEv.java:122)
 at net.sf.kernow.transform.CachedStylesheetTransformer.transform(CachedStylesheetTransformer.java:123)
 at net.sf.kernow.transform.CallableCachedTransform.call(CallableCachedTransform.java:46)
 at net.sf.kernow.transform.CallableCachedTransform.call(CallableCachedTransform.java:23)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 ... 6 more
 
When I change the size of the thread pool to something greater than 1, I get the following exception:
 
org.xml.sax.SAXException: FWK005 parse may not be called while parsing.
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
 at com.andrewjwelch.lexev.LexEv.parse(LexEv.java:117)
 at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:350)
 at com.andrewjwelch.lexev.LexEv.parse(LexEv.java:122)
 at net.sf.kernow.transform.CachedStylesheetTransformer.transform(CachedStylesheetTransformer.java:123)
 at net.sf.kernow.transform.CallableCachedTransform.call(CallableCachedTransform.java:46)
 at net.sf.kernow.transform.CallableCachedTransform.call(CallableCachedTransform.java:23)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
 at java.lang.Thread.run(Thread.java:619)
org.xml.sax.SAXException: FWK005 parse may not be called while parsing.Transformed: generate-data.xsl
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
 at com.andrewjwelch.lexev.LexEv.parse(LexEv.java:117)
 at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:350)
 at com.andrewjwelch.lexev.LexEv.parse(LexEv.java:122)
 at net.sf.kernow.transform.CachedStylesheetTransformer.transform(CachedStylesheetTransformer.java:123)
 at net.sf.kernow.transform.CallableCachedTransform.call(CallableCachedTransform.java:46)
 at net.sf.kernow.transform.CallableCachedTransform.call(CallableCachedTransform.java:23)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
 at java.lang.Thread.run(Thread.java:619)
Transformed: view-history.xsl
org.xml.sax.SAXException: FWK005 parse may not be called while parsing.
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
 at com.andrewjwelch.lexev.LexEv.parse(LexEv.java:117)
 at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:350)
 at com.andrewjwelch.lexev.LexEv.parse(LexEv.java:122)
 at net.sf.kernow.transform.CachedStylesheetTransformer.transform(CachedStylesheetTransformer.java:123)
 at net.sf.kernow.transform.CallableCachedTransform.call(CallableCachedTransform.java:46)
 at net.sf.kernow.transform.CallableCachedTransform.call(CallableCachedTransform.java:23)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
 
My XSL is:
 
<?xml version="1.0" encoding="UTF-8"?>
<x:stylesheet xmlns:x="
http://www.w3.org/1999/XSL/Transform"
      xmlns:xsl="
http://dummy"
      xmlns:saxon="
http://saxon.sf.net/"
      version="2.0">
   
    <x:output method="xml" indent="yes"/>
    <x:namespace-alias stylesheet-prefix="xsl" result-prefix="x"/>
   
    <x:template match="/"><x:text>
</x:text>
        <x:apply-templates select="* | text() | processing-instruction() | comment()"/>
    </x:template>
    <x:template match="/*" >
        <x:copy>
            <x:namespace name="saxon">http://saxon.sf.net/</x:namespace>
            <x:attribute name="version">2.0</x:attribute>
            <x:apply-templates select="* | @* | text() | processing-instruction() | comment()"/>
        </x:copy>           
    </x:template>
    <x:template match="
/*/@version"/>
    <x:template match="
/*/@extension-element-prefixes">
        <x:attribute name="extension-element-prefixes">
            <x:text>saxon </x:text><x:value-of select="."/>
        </x:attribute>           
    </x:template>
       
    <x:template match="* | @* | processing-instruction() | comment()">
        <x:copy>
            <x:apply-templates select="* | @* | text() | processing-instruction() | comment()"/>
        </x:copy>           
    </x:template>
    <x:template match="text()">
        <x:value-of select="." disable-output-escaping="yes"/>
    </x:template>
   
</x:stylesheet>
 
One of my source documents is:
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY NL "<xsl:text>
</xsl:text>">
<!ENTITY SP "<xsl:text> </xsl:text>">
<!ENTITY nbsp "&#160;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"
    xmlns:dyn="
http://exslt.org/dynamic" xmlns:dt="http://exslt.org/dates-and-times" xmlns:str="http://exslt.org/strings"
    xmlns:exist="
http://exist.sourceforge.net/NS/exist" extension-element-prefixes="exsl dyn dt str"
    exclude-result-prefixes="xsl exist">
   
    <xsl:param name="page">select-file</xsl:param>
   
    <!--  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Render form for root document.
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  -->   
    <xsl:template match="/folder">
        <xsl:variable name="layout">
            <form>
                <title>
                    <xsl:text>Select File: /</xsl:text>                   
                    <xsl:value-of select="@name"/>
                </title>                  
                <command label="Cancel"/>
                <div class="center-table">               
                    <group label="Select File">
                        <xsl:for-each select="SUPPLEMENTAL-INFO/ANCESTORS/*">
                            <tr>
                                <td class="expansion">&NL;
                                    <a href="view.jsp?path=/folder[@id='SuppDocs']//folder[@id='{@id}']&amp;page=select-file&amp;return={$parameters/parameters/return}"><img border="0" alt="Contract" src="{$skin-path}/button_minus.gif"/></a>
                                </td>&NL;
                                <td class="cell left readonly">
                                    <a href="view.jsp?path=/folder[@id='SuppDocs']//folder[@id='{@id}']&amp;page=select-file&amp;return={$parameters/parameters/return}">
                                        <xsl:text>/</xsl:text>
                                        <xsl:value-of select="@name"/>
                                    </a>
                                </td>
                                <td class="cell">&nbsp;</td>                           
                            </tr>&NL;
                        </xsl:for-each>   
                        <tr>
                            <td class="expansion">&NL;
                                <img border="0" alt="Current Folder" src="{$skin-path}/button_minus.gif"/>&NL;
                            </td>
                            <td class="cell left readonly">
                                <b><xsl:text>/</xsl:text><xsl:value-of select="@name"/></b>
                            </td>&NL;
                            <td class="cell">&nbsp;</td>                           
                        </tr>
                        <xsl:apply-templates mode="renderLinks"/>
                    </group>
                </div>
            </form>
        </xsl:variable>
        <xsl:apply-templates select="exsl:node-set($layout)/*">
            <xsl:with-param name="data" select="/"/>
        </xsl:apply-templates>
    </xsl:template>
   
    <xsl:template match="/document">
        <xsl:variable name="layout">
            <form>
                <title>
                    <xsl:text>Select File from /</xsl:text>                   
                    <xsl:value-of select="@name"/>
                </title>               
                <command label="Cancel"/>
                <div class="center-table">    
                    <group label="Select File">
                        <xsl:for-each select="SUPPLEMENTAL-INFO/ANCESTORS/*">
                            <tr>
                                <td class="expansion">&NL;
                                    <a href="view.jsp?path=/folder[@id='SuppDocs']//folder[@id='{@id}']&amp;page=select-file&amp;return={$parameters/parameters/return}"><img border="0" alt="Contract" src="{$skin-path}/button_minus.gif"/></a>
                                </td>&NL;
                                <td class="cell left readonly">
                                    <a href="view.jsp?path=/folder[@id='SuppDocs']//folder[@id='{@id}']&amp;page=select-file&amp;return={$parameters/parameters/return}">
                                        <xsl:text>/</xsl:text>
                                        <xsl:value-of select="@name"/>
                                    </a>
                                </td>&NL;
                                <td class="cell">&nbsp;</td>                           
                            </tr>
                        </xsl:for-each>
                        <xsl:apply-templates select="." mode="renderLinks">
                            <xsl:with-param name="version">true</xsl:with-param>
                        </xsl:apply-templates>
                        <xsl:apply-templates select="SUPPLEMENTAL-INFO/VERSIONS/*[@id !=
/document/@id]" mode="renderLinks">
                            <xsl:with-param name="version">true</xsl:with-param>
                        </xsl:apply-templates>
                    </group>
                </div>
            </form>
        </xsl:variable>
        <xsl:apply-templates select="exsl:node-set($layout)/*">
            <xsl:with-param name="data" select="/"/>
        </xsl:apply-templates>
    </xsl:template>
   
   
    <xsl:template match="folder" mode="renderLinks">
        <tr>
            <td class="expansion">
                <a href="view.jsp?path=/folder[@id='SuppDocs']//folder[@id='{@id}']&amp;page=select-file&amp;return={$parameters/parameters/return}"><img border="0" alt="Expand" src="{$skin-path}/button_plus.gif"/></a>
            </td>
            <td class="cell left readonly">
                <xsl:choose>
                <xsl:when test="self::folder">
                    <a href="view.jsp?path=/folder[@id='SuppDocs']//{name(.)}[@id='{@id}']&amp;page=select-file&amp;return={$parameters/parameters/return}">
                            <xsl:text>/</xsl:text>
                            <xsl:value-of select="@name"/>
                        </a>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>/</xsl:text>
                    <xsl:value-of select="@name"/>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:apply-templates mode="renderLinks"/>
            </td>
            <td class="cell">&nbsp;</td>
        </tr>           
    </xsl:template>
   
    <xsl:template match="document" mode="renderLinks">
        <xsl:param name="version"/>
       
        <xsl:variable name="URL">
            <xsl:variable name="path">
                <xsl:choose>
                    <xsl:when test="path"><xsl:value-of select="path"/></xsl:when>
                    <xsl:otherwise><xsl:call-template name="calcPath"/></xsl:otherwise>
                </xsl:choose>
            </xsl:variable>                   
            <xsl:value-of select="$appContext//mediaServiceURL"/>/fetch?path=<xsl:value-of select="$path"/>
            <xsl:if test="@version and not(contains($path,'@'))">
                <xsl:text>@</xsl:text><xsl:value-of select="@version"/>
            </xsl:if>                   
        </xsl:variable>
        <xsl:variable name="title">
            <xsl:text>/</xsl:text>
            <xsl:value-of select="@name"/>
            <xsl:if test="@version">
                &#160;(version <xsl:value-of select="@version"/>)               
            </xsl:if>
        </xsl:variable>
        <tr>
            <td class="blank">&#160;</td>
            <td class="cell left readonly">
                <xsl:choose>
                    <xsl:when test="@id =
/document/@id">
                        <b><xsl:value-of select="$title"/></b>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="$title"/>
                    </xsl:otherwise>
                </xsl:choose>
            </td>
            <td class="cmd">
                <command label="Select" href="controller.jsp?path=/folder[@id='SuppDocs']//{name(.)}[@id='{@id}']&amp;cmd=return&amp;return={$parameters/parameters/return}"/>
                <xsl:if test="not($version='true')">
                    <command label="History" href="view.jsp?path=/folder[@id='SuppDocs']//{name(.)}[@id='{@id}']&amp;page=select-file&amp;return={$parameters/parameters/return}"/>
                </xsl:if>
                <command label="View" href="{$URL}" window="viewdocument"/>               
            </td>
        </tr>           
    </xsl:template>
   
    <xsl:template match="SUPPLEMENTAL-INFO" mode="renderLinks"/>
   
    <xsl:template name="calcPath">
        <xsl:for-each select="/*/SUPPLEMENTAL-INFO/ANCESTORS/*[@name]">
            <xsl:if test="position() > 1">
                <xsl:text>/</xsl:text>
            </xsl:if>
            <xsl:value-of select="@name"/>
        </xsl:for-each>
        <xsl:if test="/folder[@name]">
            <xsl:text>/</xsl:text>
            <xsl:value-of select="
/*/@name"/>
        </xsl:if>           
        <xsl:if test="@name">
            <xsl:text>/</xsl:text>
            <xsl:value-of select="@name"/>
        </xsl:if>
    </xsl:template>   
 
</xsl:stylesheet>
 
Finally, I'm wondering if when the output directory is the same as the input directory, the utility will do an in-place transformation, so that I can recursively iterate through SVN directories and transform all the source documents in-place and then check the files in without having to copy from an output directory.  This was the strategy I was pursuing in the utility I was writing before I discovered Kernow.