[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Advise on xsl usage producing very complex html

Subject: Re: Advise on xsl usage producing very complex html
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 1 Feb 2001 09:48:15 GMT
xsl usage
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.