Hi All,
I am having problem calling a template(xsl:call-tmplate name="") that is
defined in another xsl file included using xsl:include
My master file is master.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" encoding="UTF-8"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"
/>
<xsl:preserve-space elements="*" />
<xsl:include href="nav.xsl" />
<xsl:template match="/">
<html>
<head>
<title>Some Title</title>
<link href="../../xsl/some.css" type="text/css" rel="stylesheet" />
</head>
<body>
<xsl:call-template name="navigate"/> <!-- This is the template defined in
nav.xsl -->
:
:
:
</xsl:stylesheet>
The nav.xsl is as follows:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Trasform">
<xsl:template name="navigate">
<xsl:variable name="prev"
select="substring-before(substring-after(//doc/@n,'prev='),' ')"/>
<xsl:variable name="next" select="substring-after(//doc/@n, 'next=')"/>
<xsl:if test="$prev">
<a class="nav" style="float:left; padding:0 4px">
<xsl:attribute name="href">
<xsl:value-of select="concat($prev, '.xml')"/>
</xsl:attribute>
<xsl:text>Previous Page</xsl:text>
</a>
</xsl:if>
<xsl:if test="$next">
<a class="nav" style="float:right; padding:0 4px">
<xsl:attribute name="href">
<xsl:value-of select="concat($next, '.xml')"/>
</xsl:attribute>
<xsl:text>Next Page</xsl:text>
</a>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
When I open my xml file that is connected to master.xsl using IE. It gives
me error "Named template 'navigate' does not exist in the stylesheet."
If I cut and paste the code of nav.xsl into the master.xsl file, it works.
Any pointers are greatly appreciated.
Thanks,
Manali