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

Combining two template matches

Subject: Combining two template matches
From: "Aaron Johnson" <artpunx@xxxxxxxxx>
Date: Tue, 24 Oct 2006 16:21:20 +0100
 Combining two template matches
Hello...

I have a stylesheet that contains two template matches which outputs
the results to two tables in html. I would like to combine the two so
that I only have one table, with the output of the second template
match appearing in the table cell marked "foo" thus rendering the
second template / table redundant. I have tried replacing "foo" with a
named template, but it didn't work.

Any advice would be really appreciated.

xml...

<header/>
	<navigation>
		<focusedTab unremovable="true" immutable="true" ID="38" name="Home"/>
		<inactiveTab unremovable="true" immutable="true" ID="36" name="myDetails"/>
		<inactiveTab unremovable="true" immutable="true" ID="37" name="myMarks"/>
		<inactiveTab unremovable="true" immutable="true" ID="40" name="myEmail"/>
		<inactiveTab unremovable="true" immutable="true" ID="40" name="myTimetable"/>
		<inactiveTab unremovable="true" immutable="true" ID="41"
name="Submit Coursework"/>
	</navigation>

...and xsl...

<xsl:template match="header">
<a name="uweTop" id="uweTop"></a>
<table class="headerNavigation" width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
	<td>
		<!-- Header: This contains the myUWE logo and controls for logout etc -->
		<xsl:call-template name="headerTable"/>
		<!-- Header: Ends -->
	</td>
	<td align="right"><img src="{$mediaPathSkin}/transparent.gif"
width="10" alt="" /></td>
	</tr>
	<tr>
		<td>"foo"</td>
	</tr>
	</table>
</xsl:template>

<xsl:template match="navigation">
<table class="headerNavigation" cellspacing="0" cellpadding="0"
border="0" width="100%">
<tr>
	<td>
	<table class="headerNavigation" border="0" cellspacing="0"
cellpadding="0" width="100%">	<tr>
	<xsl:apply-templates>
		<xsl:with-param name="type" select="'tab'"/>
	</xsl:apply-templates>
</tr>
	</table>	
	</td>
</tr>
</table>

my attempt...

<xsl:template name="test" match="navigation">
	<table class="headerNavigation" border="0" cellspacing="0"
cellpadding="0" width="100%">
		<tr>
			<xsl:apply-templates>
				<xsl:with-param name="type" select="'tab'"/>
			</xsl:apply-templates>
		</tr>
	</table>
</xsl:template>

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.