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
Saxonica

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 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
------------------------------------------------------------------------------ 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. http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help