Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Using a template to create a header and footer >Thread Next - Re: Using a template to create a header and footer Re: Using a template to create a header and footerTo: NULL Date: 5/9/2005 11:13:00 PM George Durzi wrote:
> I have some header Html that I would like to repeat at the top and bottom of
> an Html report generated by an xsl/t.
> Instead of pasting this xsl/t at the top and bottom of the report, how can I
> do it using a template?
>
> I looked at some of the examples of <xsl:template> and they all seem to be
> expecting a node name for the template to apply. But the header html is
> being generated from multiple sources?
>
> Can I do something like this?
> Where the <!-- Want to put header Html here -->is, I tried doing an
> <xsl:apply-templates select="HeaderHtml"/> but nothing happend.
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:template match="/">
> <html>
> <body>
> <!-- Want to put header Html here -->
> <!-- The main xsl/t of my report -->
> <!-- Want to put header Html here -->
> </body>
> </html>
> </xsl:template>
> </xsl:template name="HeaderHtml">
> <!-- Some xsl/t to generate Html I want to include at the top and bottom
> of my report -->
> </xsl:stylesheet>
>
> Thank You
>
>
Try a named template, and a call-template.
Note: The Template definition does not have a match attribute, but
instead a name attribute.
<xsl:template name="HeaderFooter">
<p>
<xsl:value-of select="document('YourOutsideSource.xml')/nodePath/Elt" />
</p>
</xsl:template>
<!-- Place this in the code where you want to render the Header/Footer -->
<xsl:call-template name="HeaderFooter">
</xsl:call-template>
--
Change "seven" to a digit to email me.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
