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

RE: call-template can't find the template?

Subject: RE: call-template can't find the template?
From: "Macaulay,Malcolm (US)" <Malcolm.Macaulay2@xxxxxxxxx>
Date: Mon, 24 Jun 2002 15:33:42 -0500
matlab template matching
Hi Greg,

I'm not sure why you're calling templates (the ones you have below should get fired when matching nodes are encountered). To call a template you need to give it a name, then use that name in the xsl:call-template e.g.:

	<xsl:template match="/">
		blah blah..
		<xsl:call-template name="myTemplate"/>
	</xsl:template>
	
	<xsl:template name="myTemplate">
		<!-- do something with the current context-->
	</xsl:template>

Hope that helps.

cheers

Malcolm


-----Original Message-----
From: Greg Kushmerek [mailto:gkushmer@xxxxxxxxxxxxx]
Sent: Monday, June 24, 2002 3:15 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  call-template can't find the template?


I'm having trouble with the call-template element.

Here's how I'm using it in my stylesheet:

<!-- p template -->
<xsl:template match="p">
<xsl:text /><xsl:apply-templates /><xsl:text/>
</xsl:template>

<!-- bu template -->
<xsl:template match="bu">
- <xsl:call-template name="p" />
</xsl:template>

I'm applying it to text such as follows:

     <p>The <tt>mstatus</tt> command tells you the status of one or more 
files in
     a sandbox with regards to the file's branch. The command is
     useful for telling you which branch a file in your sandbox comes
     from, and the file's state with regards to that branch. You use
     it to answer questions such as:</p>

     <bu>Did you get a file from the subsystem branch or someone else's 
private branch?</bu>
     <bu>Is a file locally modified?</bu>
     <bu>Do you have the latest revision of a file?</bu>

     <p>The default output shows you the file's name, its status, and
     the branch to which the file is stuck.</p>

Yet if I call Xalan (1.3 on Linux), I get this error:

XSLT error: Could not find named template., style tree node: 
xsl:call-template 
(file:///sandbox/gkushmer/A/matlab/bat/doc/batml/xsl/nroff.xsl, line 93, 
column 33)

What confuses me is how Xalan says it can't find the template when it's 
there. What
is it I'm missing?  Is this error Xalan's way of really saying "you can't 
use call-template
that way"???

Thanks,

--gk


Greg Kushmerek
Sr. Technical Writer
IA/Tools
The MathWorks
(+1) 508-647-7136


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2011 All Rights Reserved.