home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F17130_EmployeeNumberFuncs.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-30  |  3.4 KB  |  89 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- ===========================================================
  3.   Category:       DataFormatting
  4.   Sub-category:   Numeric Formatting
  5.   Author:         David Silverlight
  6.                   HeadGeek@xmlpitstop.com
  7.   Created:        2001-05-16
  8.   Description:-
  9.     This stylsheet demonstrates how various numeric formatting
  10.     masks ('000.00', '$#00%', '###0.00') can be used to display
  11.     numeric data in various output formats.
  12. ================================================================ -->
  13. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  14.   <xsl:output method="html" encoding="ISO-8859-1" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" />
  15.  
  16.   <xsl:template match="/">
  17.     <html>
  18.       <head>
  19.         <title>DataFormatting - Numeric Formatting</title>
  20.         <style type="text/css">
  21.         H1 {COLOR: red; FONT-FAMILY: Arial; FONT-SIZE: 14pt;}
  22.         H2 {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  23.         .head {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 14pt;}
  24.         .subhead {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  25.         .text {COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  26.         TH {COLOR: white; FONT-FAMILY: Arial; background-color: darkblue;}
  27.         TD {COLOR: darkblue; FONT-FAMILY: Arial}
  28.         TR { background-color: beige; }
  29.         BODY { background-color: beige; }
  30.         </style>
  31.       </head>
  32.       <body>
  33.         <h1>Employee Listing</h1>
  34.         <table border="1">
  35.           <tr>
  36.             <th>Emp ID</th>
  37.             <th>Name</th>
  38.             <th>Hourly Rate</th>
  39.             <th>000.00</th>
  40.             <th>$#00%</th>
  41.             <th>###0.00</th>
  42.             <th>#,00;(#,00)</th>
  43.             <th>#,00;#,00CR</th>
  44.             <th>#,###,###</th>
  45.             <th>##.##</th>
  46.             <th>#,##0.00</th>
  47.           </tr>
  48.           <xsl:for-each select="/employees/employee">
  49.             <tr>
  50.               <td>
  51.                 <xsl:value-of select="@EmployeeID" />
  52.               </td>
  53.               <td>
  54.                 <xsl:value-of select="concat(@FirstName, ' ', @LastName)" />
  55.               </td>
  56.               <td>
  57.                 <xsl:value-of select="@HourlyRate" />
  58.               </td>
  59.               <td>
  60.                 <xsl:value-of select="format-number(number(@HourlyRate),'000.00')" />
  61.               </td>
  62.               <td>
  63.                 <xsl:value-of select="format-number(number(@HourlyRate),'$#00%')" />
  64.               </td>
  65.               <td>
  66.                 <xsl:value-of select="format-number(number(@HourlyRate),'###0.00')" />
  67.               </td>
  68.               <td>
  69.                 <xsl:value-of select="format-number(number(@HourlyRate),'#,00;(#,00)')" />
  70.               </td>
  71.               <td>
  72.                 <xsl:value-of select="format-number(number(@HourlyRate),'#,00;#,00CR')" />
  73.               </td>
  74.               <td>
  75.                 <xsl:value-of select="format-number(number(@HourlyRate),'#,###,###')" />
  76.               </td>
  77.               <td>
  78.                 <xsl:value-of select="format-number(number(@HourlyRate),'##.##')" />
  79.               </td>
  80.               <td>
  81.                 <xsl:value-of select="format-number(number(@HourlyRate),'#,##0.00')" />
  82.               </td>
  83.             </tr>
  84.           </xsl:for-each>
  85.         </table>
  86.       </body>
  87.     </html>
  88.   </xsl:template>
  89. </xsl:stylesheet>