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]

Multiple xsl files


hi 

 I am trying to create reusable style sheets
 I am using the following xmlxsl files..

 test.xml
-----------
<?xml version="1.0"?>
<TR300>
  <ChargeListRSQ>
     <Charge id="1">ABC</Charge>
     <Charge id="2">DEF</Charge>
  </ChargeListRSQ>
</TR300>
-------------------
reusable.xsl
----------------------
<?xml version='1.0' ?><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match='ChargeListRSQ'>
     <table border="1">
        <xsl:for-each select="Charge">
          <tr>
             <td><xsl:value-of select="@id"/></td>
             <td><xsl:value-of select="."/></td>
          </tr>
        </xsl:for-each>
     </table>
   </xsl:template>
</xsl:stylesheet>
---------------------------
main.xsl
---------------------------
<?xml version='1.0' ?><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="html" indent="yes"/>

  <xsl:include href="reusable.xsl"/>

  <xsl:template match="/">
    <html>
      <body>
         <xsl:apply-templates/>
      </body>
    </html>
</xsl:stylesheet>

-----------------------------
output.html
---------------------------

<html>
   <body>
      
      <table border="1">
         <tr>
            <td>1</td>
            <td>ABC</td>
         </tr>
         <tr>
            <td>2</td>
            <td>DEF</td>
         </tr>
      </table>
      
   </body>
</html>
--------------------------------------------------------

this works fine...but my requirement is
to add table header  to the html output using main.xsl 
i don't want to make any change in reusable.xsl 
Is it possible to do that ? if yes give me some ideas 

thanks in advance
//pavanan

 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]