xsl-list
[Top] [All Lists]

Separating layout and content

2006-02-23 23:45:19
Hi,

i have several types of documents that i want to display in HTML having
the same overall layout. Doctype specific differences are kept in a
doctype specific stylesheet.

At the moment the following solution works:

1. The doctype specific stylesheet doctypeA.xsl calls
        <xsl:call-template name="doLayout"/>

2. doLayout is imported from layout.xsl and looks as follows:

<xsl:template name="doLayout">
        <!-- e.g. a rather simple snipet of site layout -->
        <table width="100%" cellpadding="3" class="TableRahmenkpl">
                <tr valign="top">
                        <td class="TD">
                                <xsl:call-template name="navigation" />
                                <xsl:call-template name="head" />
                                <xsl:call-template name="title" />
                                <xsl:call-template name="text" />       
                        </td>
                </tr>
        </table>
</xsl:template>

3. Each of the doctype specifiy stylesheets holds the above templates
implementing each part of the doctype specific output:
<xsl:template name="navigation">
        <!-- output the doctype specific navigation -->
        ...
</xsl:template>
<xsl:template name="head">
        <!-- output the doctype specific head -->
        ...
</xsl:template>
<xsl:template name="title">
        <!-- output the doctype specific title -->
        ...
</xsl:template>
<xsl:template name="text">      
        <!-- output the doctype specific text -->
        ...
</xsl:template>

I wonder whether there is a better way to do this. Any Ideas?

Best regards,
Thomas.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • Separating layout and content, Lensch, Thomas <=