This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]