home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / xmlspy35.exe / Main / altova.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-06-19  |  2.3 KB  |  107 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:b="http://www.xmlspy.com/schemas/Altova/orgchart">
  3.     <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="no" indent="no" media-type="text/html"/>
  4.     <!--XSL Stylesheet for generating simple Orgchart-->
  5.     <xsl:template match="b:Altova">
  6.         <html>
  7.             <head>
  8.                 <title>
  9.                     <xsl:value-of select="Name"/>
  10.                 </title>
  11.             </head>
  12.             <body>
  13.                 <h1>
  14.                     <xsl:value-of select="Name"/>
  15.                 </h1>
  16.                     <table width="100%">
  17.                         <xsl:for-each select="Division">
  18.                             <xsl:apply-templates select="."/>
  19.                         </xsl:for-each>
  20.                     </table>
  21.             </body>
  22.         </html>
  23.     </xsl:template>
  24.     <xsl:template match="b:Altova/Division">
  25.         <tr>
  26.             <td>
  27.                 <hr/>
  28.                 <h2>
  29.                     <a>
  30.                         <xsl:attribute name="href"><xsl:value-of select="URL"/></xsl:attribute>
  31.                         <xsl:value-of select="Name"/>
  32.                     </a>
  33.                 </h2>
  34.                 <p>
  35.                     <xsl:value-of select="Desc"/>
  36.                 </p>
  37.                 <table>
  38.                     <tr>
  39.                         <td>
  40.                             <h4>Title</h4>
  41.                         </td>
  42.                         <td>
  43.                             <h4>First</h4>
  44.                         </td>
  45.                         <td>
  46.                             <h4>Last</h4>
  47.                         </td>
  48.                         <td>
  49.                             <h4>Ext</h4>
  50.                         </td>
  51.                         <td>
  52.                             <h4>Club</h4>
  53.                         </td>
  54.                     </tr>
  55.                     <xsl:apply-templates select="b:Person|b:VIP"/>
  56.                 </table>
  57.             </td>
  58.         </tr>
  59.     </xsl:template>
  60.     <xsl:template match="b:Person">
  61.         <tr>
  62.             <td>
  63.                 <xsl:value-of select="Title"/>
  64.             </td>
  65.             <td>
  66.                 <xsl:value-of select="First"/>
  67.             </td>
  68.             <td>
  69.                 <b>
  70.                     <a>
  71.                         <xsl:attribute name="href">mailto:<xsl:value-of select="EMail"/></xsl:attribute>
  72.                         <xsl:value-of select="Last"/>
  73.                     </a>
  74.                 </b>
  75.             </td>
  76.             <td>
  77.                 <xsl:value-of select="PhoneExt"/>
  78.             </td>
  79.             <td/>
  80.         </tr>
  81.     </xsl:template>
  82.     <xsl:template match="b:VIP">
  83.         <tr bgcolor="yellow">
  84.             <td>
  85.                 <xsl:value-of select="Title"/>
  86.             </td>
  87.             <td>
  88.                 <xsl:value-of select="First"/>
  89.             </td>
  90.             <td>
  91.                 <b>
  92.                     <a>
  93.                         <xsl:attribute name="href">mailto:<xsl:value-of select="EMail"/></xsl:attribute>
  94.                         <xsl:value-of select="Last"/>
  95.                     </a>
  96.                 </b>
  97.             </td>
  98.             <td>
  99.                 <xsl:value-of select="PhoneExt"/>
  100.             </td>
  101.             <td>
  102.                 <xsl:value-of select="Club"/>
  103.             </td>
  104.         </tr>
  105.     </xsl:template>
  106. </xsl:stylesheet>
  107.