Problem with label call-template in XSLT
I'm doing a series of XSL templates, but we did make them run on php-xsl. The problem I have is with the import and XSL inclucion other files, and palicacion of temples. I have the first file
<xsl:import开发者_运维问答 href="forms.xsl"/>
<xsl:template match="/">
<a id="logo"><xsl:value-of select="web/general/title"/></a>
<xsl:call-template name="search" />
</xsl:template>
</xsl:stylesheet>
and I have forms.xsl file
<xsl:template match="search">
<form>
<label>search</label>
<input type="text" name="search" title="Search" />
<input type="botton" name="search"/>
</form>
</xsl:template>
but when I put on the run, I do not show anything. That's what I'm doing wrong?
In the forms.xsl, you need to change
<xsl:template match="search">
to
<xsl:template name="search">
Match will always match the xml expression, whereas name explicitly gives a name to a template.
If this doesn't work, please post the source xml and what you would like to see in the target.
精彩评论