[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Insert Footer And not Header using XSL


Subject: Re: [xsl] Insert Footer And not Header using XSL
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 12 Jan 2004 13:25:19 GMT

<xsl:template  match="body">
<body>
	Header_Text
	<a href="http://www.google.com">
	<img src="D:\logo.gif"/></a>
  	<xsl:apply-templates select="*|text()|@*" /> 
Footer_text
  		<a href="http://www.google.com">
	<img src="D:\logo.gif"/></a>
</body>
 </xsl:template>


Note that D:\logo.gif is not a URI, as it uses an unknown uri scheme, D:
and uses \ rather than / as separator, that should be
file:///d:/logo.gif not that it makes any difference to xslt, which
simply treats it as an attribute value string.


If you want to pull out the texts to separate templates, something like


<xsl:template  match="body">
<body>
        <xsl:call-template name="header"/>
  	<xsl:apply-templates /> 
        <xsl:call-template name="footer"/>
</body>
 </xsl:template>

<xsl:template name="header">
	Header_Text
	<a href="http://www.google.com">
	<img src="/logo.gif"/></a>
</header>

<xsl:template name="footer">
	footerr_Text
	<a href="http://www.google.com">
	<img src="/logo.gif"/></a>
</header>


-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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



Current Thread
Keywords