I think you would find it worthwhile studying the FXSL technique pioneered
by Dimitre Novatchev. This uses apply-templates rather than call-template
for the dynamic call; you steer it dynamically to call a particular template
by supply a node that matches that template only.
Michael Kay
- Hi Michael, thanks for the directions. I tried using xsl:choose with
call-template and that proved illegal (at least in sablotron). Tried
apply-templates with variables but that didn't work too, tried
apply-templates using Qnames with xsl:choose but had a problem with
selecting the correct block of nodes; the conditions are set in the main
template (see below). Maybe I havta return to the drawing board.
<xsl:param name="param_DocID" />
<xsl:template match="/">
<xsl:choose>
<xsl:when test="not($param_DocID)">
<xsl:apply-templates select="*/*/base:Section" />
</xsl:when>
<xsl:when test="*/*/base:Section[//@ID=$param_DocID]">
<xsl:apply-templates select="*/*/base:Section[(_at_)ID=$param_DocID]" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="missingDoc" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="base:Section">
<xsl:call-template name="Title" />
<xsl:call-template name="DatePublished" />
<xsl:call-template name="Desc" />
<xsl:call-template name="DateModified" />
<xsl:call-template name="Author" />
</xsl:template>
<xsl:template name="Author">
<div class="cell_author">
<xsl:value-of select="base:Author" />
</div>
</xsl:template>
...
_________________________________________________________________
Find it on the web with MSN Search. http://search.msn.com.sg/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list