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

apply-template question...

Subject: apply-template question...
From: "Mirick, John" <jmirick@xxxxxxxxxxxx>
Date: Mon, 16 Oct 2000 17:30:54 -0400
apply template namespace
I have two XSL files for each XML file. One XSL file contains global
information the other contains page specific information. A good example of
this would be sections in a form

<!-- IN the xml file -->
<section name="empInfo">
	<header>Employee Information</header>	
	<comment>Enter employee details below</comment>
	<content>
		<input type="text" name="ssn"/>
		<input type="date" name="hireDate"/>
	</content>
</section>

The template for section, header, comment and input would all be in the
global file.... however the content template would be in the local file. The
html that is produced will be different for content part of a section,
however headers for any section will always produce the same html.

Each local xsl file always imports the global xsl file.

Now comes my question....
I want to be able to conditionally show sections within a page. Im having a
hard time figuring out how to do this...

The ideal way I think would be to override the global template in the page
specific xsl file with something like...

<!-- in the local xsl file -->
<xsl:template name="section">
	<xsl:when test="@name = 'empInfo'">
		<!-- Somehow apply the global template of section: I dont
know how. -->
	 </xsl:when>
</xsl:template>

What I want to avoid is having the same section template code in both the
local and global file... if I need to make a change as to how sections are
rendered I only want to have to worry about the global file.

On the pages where I do not need to conditionally show sections I would like
for the global template to be applied without any code in the page specific
xsl page.

Hope that made sense... Ive only been tooling around with xsl for about the
last month so there might be something obvious that im missing...

thanks,
John Paul


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