cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kuppa Kiran Kumar <Kup...@PLANETASIA.COM>
Subject XSL: IE5 parses properly. But not cocoon
Date Wed, 07 Mar 2001 04:51:10 GMT
Hi All, Here i face a silly problem which has ben bugging me -:(.Plz help me
out.

The Problem: An xml file is being properly parsed and style sheet is being
applied properly by IE5.0. The same xml file, when i give it to XSLT
processor of cocoon, it does'nt apply style sheet properly.
Here is the xml file:

<?xml version ="1.0"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet type ="text/xsl" href="book_index2.xsl"?>
<Book>
   <chapter num="1">
       <Name>Name of the first Chapter</Name>
       <section num="1">
               <Name>Name of first section in first chapter</Name>
               <Source>Source xml file of this section</Source>
       </section>
       <section num="2">
               <Name>Name of the second section in first chapter</Name>
               <Source>Source xml file of this section</Source>
       </section>
  </chapter>
  <chapter num="2">
       <Name>Name of the Second Chapter</Name>
           <section num="1">
                   <Name>Name of first section in Second chapter</Name>
                   <Source>Source xml file of this section</Source>
           </section>
           <section num="2">
               <Name>Name of first section in Second chapter</Name>
               <Source>Source xml file of this section</Source>
       </section>
           <section num="3">
               <Name>Name of Third section in Second chapter</Name>
               <Source>Source xml file of this section</Source>
       </section>
   </chapter>
</Book>

And the corresponding XSL file:

<?xml version ="1.0"?>
<xsl:stylesheet xmlns:xsl ="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
       <head><title>Index page of books</title></head>
       <body>
           <xsl:apply-templates/>
          
       </body>
</html>
</xsl:template>
       <xsl:template match="Book">
       <xsl:apply-templates select="chapter"/>
       <br/>
       </xsl:template>

       <xsl:template match="chapter">
           <h3>Chapter :<xsl:value-of select="@num"/></h3>
           <xsl:element name="a">
               <xsl:attribute name="href">
               </xsl:attribute>
           <h3><i ><b><xsl:value-of select="Name"/></b></i></h3>
    
           <br/>
           </xsl:element>
           <xsl:apply-templates select="section"/>
       </xsl:template>
       <xsl:template match ="section">
           <h4>Section:<xsl:value-of select="@num"/></h4>
           <i><xsl:value-of select="Name"/></i>
           <br/>
           The chapter number of this section is :<xsl:value-of
select="ancestor(chapter)/@num"/>
          
       </xsl:template>
</xsl:stylesheet>

IE is able to apply templates recursively to display all the chapter and
section tags. But not cocoon .Help wanted. Thanx in advance.

Kupps


Mime
View raw message