This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Advise on xsl usage producing very complex html
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Advise on xsl usage producing very complex html
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Thu, 1 Feb 2001 09:48:15 GMT
- References: <19897860536.20010131143106@phreaker.net><200101311309.NAA17940@nag.co.uk> <193103262513.20010131160108@phreaker.net><200101311843.SAA17816@nag.co.uk> <325095587.20010201105059@phreaker.net>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> the question is:
Ah. Ok well in that case I think I'd go with Mike Kay's suggestion.
Specifically if you can arrange that each of your large chunks is a well
formed XML fragment with as many </xxx> as <xxx> you can stick them in
separate documents such as
big-chunk-of table-head.xml
big-chunk-of-table-foot.xml
big-chunk-of-html-head.xml
Then your stylesheet looks something like this
<xsl:stylesheet....>
<xsl:variable name="html-head"
select="document('big-chunk-of-html-head.xml')"/>
<xsl:variable name="table-head"
select="document('big-chunk-of-table-head.xml')"/>
<xsl:variable name="table-foot"
select="document('big-chunk-of-table-foot.xml')"/>
<xsl:template match="/">
<html>
<!-- the <head> eleemnt pulled in from file -->
<xsl:copy-of select="$html-head"/>
<body>
<xsl:templates/>
</body>
</html> <!-- the <head> eleemnt pulled in from file -->
<xsl:copy-of select="$html-head"/>
</xsl:template>
<xsl:template match="input-table-element">
<table>
<!-- the <thead> eleemnt pulled in from file -->
<xsl:copy-of select="$table-head"/>
<!-- the <tfoot> eleemnt pulled in from file -->
<xsl:copy-of select="$table-foot"/>
<tbody>
<xsl:templates/>
</tbody>
</table>
</xsl:template>
</xsl:stylesheet>
Note thatthis way whoever is writing the "templates" for the
table head and foot need only write (X)HTML code, and not any XSL syntax
at all.
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list