Quantcast
Viewing all articles
Browse latest Browse all 32060

problem in XSL

Hi,

I am getting problem with transformation of a xml file into html.

here is my xml file:

<category id="111">
<Fname table="pages">Darma</Fname>
<Fname table="pages">Teja</Fname>
<Fname table="pages">Kongavarapu</Fname>
</category>

       <category id="222">
<Fname table="pages">sri</Fname>
<Fname table="pages">ram</Fname>
<Fname table="pages"><p>sriram</p></Fname>
</category>


actually i wrote code in xslt like this:

<xsl:template match="/">
  <html>
  <body>   
 
 <xsl:value-of  select="category[1]/Fname[1]/text()"/>  <br/>   
  <xsl:value-of  select="category[1]/Fname[2]/text()"/>  <br/> 
  <xsl:value-of  select="category[1]/Fname[3]/text()"/>  <br/>

  <xsl:value-of  select="category[2]/Fname[1]/text()"/>  <br/>   
  <xsl:value-of  select="category[2]/Fname[2]/text()"/>  <br/> 
  <xsl:value-of  select="category[2]/Fname[3]/text()"/>  <br/>
  
  
  </body>
    
  </html>
</xsl:template>


It works. Here I gave you just two categories. If I have 1000 categories, How can I  put the loop?


Thanks,

Darma


Viewing all articles
Browse latest Browse all 32060

Trending Articles