[xsl] Transforming Rows to columns

Subject: [xsl] Transforming Rows to columns
From: bernard eugene <eugene_bernard@xxxxxxxxx>
Date: Tue, 10 Aug 2004 05:23:20 -0700 (PDT)
Hi all 

I having one problem ie to transform the row contents
to columns. any help appreciated.

xml :


<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="asset.xsl"?>
<asset>
<record>
<srn>
SFL                 
</srn>
<type>
Thick     
</type>
<serial>
IN12500360  
</serial>
<make>
HP Brio BA410
</make>
<model>
D4194A
</model>
<vendor>
Megatrends          
</vendor>
<processor>
Intel PIII
</processor>
<speed>
 1000
</speed>
<monsrl>
CN94703448          
</monsrl>
<montr>
D8894A              
</montr>
<monsz>
                    
</monsz>
<monven>
Megatrends
</monven>
<memory>
   128
</memory>
<hd>
20GB   
</hd>
<cd>
Yes
</cd>
<fdd>
Yes
</fdd>
<comp>
ABC Limited
</comp>
<loc>

</loc>
<dept>

</dept>
<fano>

</fano>
</record>


XSL :


  <?xml version="1.0" encoding="ISO-8859-1" ?> 
- <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns="http://www.w3.org/TR/REC-html40";>
- <xsl:template match="/">
- <html>
- <body>
  <h4>IT Asset Details</h4> 
- <table border="1" cellpadding="4" cellspacing="0">
- <tr bgcolor="#9acd32">
  <th>Systems Reference Number</th> 
  <th>Type</th> 
  <th>Machine Serial No</th> 
  <th>Make</th> 
  <th>Model</th> 
  <th>Processor</th> 
  <th>Speed</th> 
  <th>Monitor Serial Number</th> 
  <th>Make and Model</th> 
  <th>Monitor Size</th> 
  <th>Vendor</th> 
  <th>Memory</th> 
  </tr>
- <xsl:for-each select="asset/record">
- <tr>
- <td>
  <xsl:value-of select="srn" /> 
  </td>
- <td>
  <xsl:value-of select="type" /> 
  </td>
- <td>
  <xsl:value-of select="serial" /> 
  </td>
- <td>
  <xsl:value-of select="make" /> 
  </td>
- <td>
  <xsl:value-of select="model" /> 
  </td>
- <td>
  <xsl:value-of select="processor" /> 
  </td>
- <td align="right">
  <xsl:value-of select="speed" /> 
  </td>
- <td>
  <xsl:value-of select="monsrl" /> 
  </td>
- <td>
  <xsl:value-of select="montr" /> 
  </td>
- <td>
  <xsl:value-of select="monsz" /> 
  </td>
- <td>
  <xsl:value-of select="monven" /> 
  </td>
- <td>
  <xsl:value-of select="memory" /> 
  </td>
  </tr>
  </xsl:for-each>
  </table>
  </body>
  </html>
  </xsl:template>
  </xsl:stylesheet>


OUTPUT I REQUIRE IS IN COLUMNWISE ie Whatever output
comes using this xsl would appear in columns.

Thanks
Eugene




		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

Current Thread