[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl:call-template not recognizing templates defined in

Subject: xsl:call-template not recognizing templates defined in included xsl document
From: "Manali Bhole" <mbhole@xxxxxxxxxxxx>
Date: Fri, 14 May 2004 13:03:28 -0400
manali bhole
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.