xsl-list
[Top] [All Lists]

RE: Insert Header as well as Wrap the whole content in Table

2004-01-22 10:58:43
Two templates matching the same element can be distinguished and used 
separately if each has a "mode" attribute with different values. Look in using 
the "mode" attribute on your templates.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Animesh Sharma <asharma(_at_)in(_dot_)firstrain(_dot_)com>
Sent:     Thu, 22 Jan 2004 11:46:22 +0530
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  [xsl] Insert Header as well as Wrap the whole content in Table

Hi,

I want to insert header in an XHTML and as well as want the whole content to be 
wrap in a table.

Presentely I'm using following template for the both operations:

For Header:

<xsl:template  match="body">
        Header_Text
        <a href="http://www.google.com";>
        <img src="D:\logo.gif"/></a>
          <xsl:apply-templates select="*|text()|@*" /> 
</xsl:template>

<xsl:template match="*|text()|@*">
       <xsl:copy>
         <xsl:apply-templates select="*|text()|@*" />
       </xsl:copy>
</xsl:template>

To Wrap:

<xsl:template match="body">
<body>
<xsl:apply-templates select="@*"/>
        <table cellspacing="0" cellpadding="0" width="65%" border="0">
                <tbody><tr><td><table><tbody><tr><td>
                <xsl:apply-templates select="*|text()"/>                        
                        
                </td></tr></tbody></table></td></tr></tbody>
        </table>
</body>
</xsl:template>

<xsl:template match="*|text()|@*">
       <xsl:copy>
         <xsl:apply-templates select="*|text()|@*" />
       </xsl:copy>
</xsl:template>

Since both the template above use the same match i.e. "body", It is not 
possible to use both simultaneously. 
I want to create two independent template which if inserted in the same XSL 
will give me the desired result.
I want template to be working independently as well as in combined form.

Thanks in advance,
Animesh

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




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



<Prev in Thread] Current Thread [Next in Thread>