Re: header/footer: How to to separate html-tag in to different xsl-template rules?

Subject: Re: header/footer: How to to separate html-tag in to different xsl-template rules?
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Fri, 23 Jun 2000 09:41:48 -0400
Hans-Guenter Stein wrote:
> 
> My problem
> is, that I cannot have a tag like "body" in an <xsl:template>, whithout
> closing it.

Can you step back up a level?

<xsl:template match="/">
  <html>
    <head>
      <xsl:apply-templates select="header" mode="title" />
    </head>
    <body>
      <xsl:apply-templates select="header" mode="h1" />
      <xsl:apply-templates select="content" />
      <xsl:apply-templates select="footer" />
    </body>
  </html>
</xsl:template>

The problems that you're seeing generally indicate a non-hierarchical
input format, or a grouping of information that doesn't match your
output format. You can either re-design your input format (for the above
example you might split "title" info from "h1" info), or just deal
with it in the XSL using something like the example above.

Hope this helps.

-- 
Warren Hedley


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


Current Thread