home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 December / INTERNET97.ISO / pc / software / windows / building / xmlspy / setup44.exe / Data1.cab / F1586_Company.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-03-20  |  1.5 KB  |  49 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xsi ="http://www.w3.org/2000/10/XMLSchema-instance"
  4. xmlns:my="http://my-company.com/namespace">
  5.  
  6. <xsl:template match="/">
  7.     <html>
  8.         <head>    <title>Your company</title></head>
  9.             <body>
  10.                 <h1><center>Your Company</center></h1>
  11.                 <xsl:apply-templates select="//my:Address"/>
  12.                     <table border="1" bgcolor="lime">
  13.                         <thead align="center">
  14.                             <td><strong>First</strong></td>
  15.                             <td><strong>Last</strong></td>
  16.                             <td><strong>Ext.</strong></td>
  17.                             <td><strong>E-Mail</strong></td>
  18.                             <td><strong>Manager</strong></td>
  19.                             <td><strong>Degree</strong></td>
  20.                             <td><strong>Programmer</strong></td>
  21.                         </thead>
  22.                         <xsl:apply-templates select="//my:Person"/>
  23.                     </table>
  24.             </body>
  25.     </html>
  26. </xsl:template>
  27.  
  28. <xsl:template match="my:Address">
  29.     <strong>Name: </strong><xsl:value-of select="my:Name"/><br/>
  30.     <strong>Street: </strong><xsl:value-of select="my:Street"/><br/>
  31.     <strong>City: </strong><xsl:value-of select="my:City"/><br/>
  32.     <strong>State: </strong><xsl:value-of select="my:State"/><br/>
  33.     <strong>Zip: </strong><xsl:value-of select="my:Zip"/><br/>
  34.     <br></br>
  35. </xsl:template>
  36.  
  37. <xsl:template match="my:Person">
  38.     <tr>
  39.         <xsl:for-each select="*">
  40.             <td><xsl:value-of select="."/></td>
  41.         </xsl:for-each>
  42.         
  43.         <xsl:for-each select="@*">
  44.             <td><xsl:value-of select="."/></td>
  45.         </xsl:for-each>
  46.     </tr>
  47. </xsl:template>
  48. </xsl:stylesheet>
  49.