Basically the answer is that the result document uses the HTML DOM, and the HTML DOM does not use namespaces. I'm not sure exactly what works and what doesn't, and it may be browser-dependent, but it's best to treat HTML as being namespace-free.

I struggled to get SVG working because of these limitations. I did have it working at one stage, but I'm not entirely sure how. I need to do further work on this: it's quite likely I will have to do some special-casing because the mapping of the HTML DOM onto the XSLT (XDM) model is imperfect.

Michael Kay

On 11/08/2011 14:44, tom tom wrote:
I'm a little confused with how namespaces are intended to be implemented when using Saxon CE. I will use to illustrate.

In the source XML I have assigned everything to a namespace: <BOOKLIST xmlns="">

I have put books.html into an XHTML namespace:  <html xmlns="">

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

<xsl:transform xmlns:xhtml="" xmlns:xsl="" xmlns:ixsl="" xmlns:book="" xmlns:prop="" xmlns:style="" xmlns:xs="" 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)"/>

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? 


------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it.
_______________________________________________ saxon-help mailing list archived at