Re: [xsl] two-phase transformation fails to match with expected template.

Subject: Re: [xsl] two-phase transformation fails to match with expected template.
From: Jeroen Hellingman <jeroen@xxxxxxxx>
Date: Tue, 24 Nov 2009 23:17:50 +0100
Thanks Michael, that did the trick.

Actually, the original was using the http://www.daisy.org/z3986/2005/ncx/ namespace.

Interesting I had to create an explicit prefix for it:

   <xsl:stylesheet
       xmlns="http://www.daisy.org/z3986/2005/ncx/";
       xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/";
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
       version="2.0">

<!-- ..... -->

<xsl:template match="ncx:navPoint" mode="playorder">
<xsl:copy>
<xsl:attribute name="playOrder"><xsl:number level="any" count="ncx:navPoint"/></xsl:attribute>
<xsl:apply-templates select="@*|node()" mode="playorder"/>
</xsl:copy>
</xsl:template>


The full, now functional, style sheet is here: http://code.google.com/p/tei2html/source/browse/trunk/tei2ncx.xsl

Jeroen.

Michael Kay wrote:
You created the navPoint element in the namespace
http://www.w3.org/1999/xhtml (which seems a bad idea, but if you do it, then
you need to match it in that namespace).


Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay

Current Thread