I'm a little confused with how namespaces are intended to be implemented when using Saxon CE. I will use http://www.saxonica.com/ce/doc/samples/booklist.xml to illustrate.

In the source XML I have assigned everything to a namespace: <BOOKLIST xmlns="http://www.book.com">

I have put books.html into an XHTML namespace:  <html xmlns="http://www.w3.org/1999/xhtml">

in books.xsl I declare all the namespaces I intend to reference:

<xsl:transform xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ixsl="http://saxonica.com/ns/interactiveXSLT" xmlns:book="http://www.book.com" xmlns:prop="http://saxonica.com/ns/html-property" xmlns:style="http://saxonica.com/ns/html-style-property" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs prop" extension-element-prefixes="ixsl" version="2.0">

however Xpath references to xhtml-namespaced elements within books.xsl do not seem to work: 

<xsl:template match="xhtml:th" mode="ixsl:onclick">
<xsl:variable name="colNr" as="xs:integer" select="count(preceding-sibling::xhtml:th)+1"/>
<xsl:apply-templates select="ancestor::xhtml:table[1]" mode="sort">
<xsl:with-param name="colNr" select="$colNr"/>
<xsl:with-param name="dataType" select="if (@data-type='number') then 'number' else 'text'"/>
<xsl:with-param name="ascending" select="not(../../@data-order=$colNr)"/>
</xsl:apply-templates>
</xsl:template>

I have tried a few alternatives (such as turning books.html into books.xhtml, using the xpath-default-namespaces att etc) to no avail. Does the processor currently only work when the 'template' html file is non-namepaced? 

Thanks

Tom