<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="article">
   <html>
   <body>
      <center>
         <h1><xsl:value-of select="title"/></h1>
         <h3>Javid Jamae</h3>
         <br/>
         <i><xsl:value-of select="abstract"/></i>
         <hr/>
      </center>

      <xsl:call-template name="contents"/>

      <xsl:for-each select="section">
         <a>
             <xsl:attribute name="name">
                #<xsl:value-of select="title"/>
             </xsl:attribute>      
         </a>
         <h1><xsl:value-of select="title"/></h1>      
         <xsl:for-each select="paragraph">
            <p><xsl:value-of select="."/></p>
         </xsl:for-each>
         <xsl:for-each select="sub-section">  
            <a>
               <xsl:attribute name="name">
                  #<xsl:value-of select="title"/>
               </xsl:attribute>      
            </a>
            <h3><xsl:value-of select="title"/></h3>      
            <xsl:for-each select="paragraph">
              <p><xsl:value-of select="."/></p>
            </xsl:for-each>
         </xsl:for-each>
      </xsl:for-each>
   </body>
   </html>
</xsl:template>

<xsl:template name="contents">

      <b>Contents:</b>

      <xsl:for-each select="section">
         <ul>
            <li>
               <a>   
                  <xsl:attribute name="href">
                     #<xsl:value-of select="title"/>
                  </xsl:attribute>      
                  <xsl:value-of select="title"/>
               </a>
            </li>
            <xsl:for-each select="sub-section">  
               <ul>
                  <li>
                     <a>   
                        <xsl:attribute name="href">
                           #<xsl:value-of select="title"/>
                        </xsl:attribute>      
                        <xsl:value-of select="title"/>
                     </a>
                  </li>
               </ul>
            </xsl:for-each>  
         </ul>
      </xsl:for-each>
</xsl:template>

</xsl:stylesheet>