home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 June / CHIP_CD_2004-06.iso / bonus / buhgal / files / M12USWEB.exe / RCDATA / CABINET / money.cab / msmoney.chm / hhglossary.xsl < prev    next >
Extensible Markup Language  |  2003-06-18  |  5KB  |  168 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3. <xsl:script language="JScript">
  4. <![CDATA[
  5. var mchCrrnt = "";
  6. var miCrrnt  = 0;
  7. var miTrack  = 0;
  8. var mbGuid   = 0;
  9. function GetUniqueID()
  10. {
  11.     if(miTrack < 2)
  12.     {
  13.         ++miTrack;
  14.         return "msmnyDropDownField" + mbGuid;
  15.     }
  16.     else
  17.     {
  18.         miTrack = 1;
  19.         ++mbGuid;    
  20.         return "msmnyDropDownField" + mbGuid;
  21.     }
  22. }
  23. function MakeAnchor(hParam)
  24. {
  25.     if(mchCrrnt != hParam.text.substring(1,0).toLowerCase()
  26.         && isNaN(parseInt(hParam.text.substring(1,0))))
  27.     {
  28.         var cibNxt  = miCrrnt;
  29.         var rghItem = hParam.selectNodes("//alphabet/item");
  30.         for(;cibNxt < rghItem.length;)
  31.         {
  32.             if(mchCrrnt != rghItem.item(cibNxt).text.substring(1,0).toLowerCase())
  33.             {
  34.                 mchCrrnt = rghItem.item(cibNxt).text.substring(1,0).toLowerCase();
  35.                 miCrrnt  = cibNxt;
  36.                 break;
  37.             }
  38.             cibNxt++;
  39.         }
  40.         return mchCrrnt;
  41.     }
  42. }
  43. ]]>
  44. </xsl:script>
  45. <xsl:template match="/">
  46. <xsl:element name="HTML">
  47.     <xsl:element name="HEAD">
  48.         <xsl:element name="TITLE"><xsl:value-of select="*/index/title" /></xsl:element>
  49.         <xsl:element name="STYLE">
  50.         <xsl:attribute name="TYPE">text/css</xsl:attribute>
  51.         BODY
  52.         {
  53.         font                : 8pt tahoma;
  54.         color                : #000000;
  55.         background-color    : #fffef9;
  56.         margin                : 0.0em 0.5em 0.5em 0.5em;
  57.         }
  58.         H3
  59.         {
  60.         font                : 8pt tahoma;
  61.         font-weight            : bold;
  62.         color                : #ffffff;
  63.         background-color    : #666666;
  64.         margin                : 0.0em -0.5em 0.0em -0.5em;
  65.         padding                : 0.8em 0.8em;
  66.         }
  67.         A
  68.         {
  69.         color                : #000000;
  70.         text-decoration        : none;
  71.         cursor                : default;
  72.         }
  73.         BUTTON
  74.         {
  75.         font                : 8pt tahoma;
  76.         width                : 1.5em;
  77.         height                : 1.5em;
  78.         margin                : 0.1em 0.05em;
  79.         text-align            : center;
  80.         border                : 1px solid #c0c0c0;
  81.         background-color    : #c0c0c0;
  82.         }
  83.         IMG
  84.         {
  85.         margin-right        : 0.3em;
  86.         }
  87.         #ButtonMenu
  88.         {
  89.         margin                : 0.0em -0.5em 0.5em -0.5em;
  90.         padding                : 0.1em 0.1em;
  91.         background-color    : #c0c0c0;
  92.         }
  93.         </xsl:element>
  94.         <xsl:element name="SCRIPT">
  95.             <xsl:comment>
  96.             <![CDATA[
  97.             function ScrollIntoView()
  98.             {
  99.                 document.all.tags("A")[event.srcElement.getAttribute("anchorTarget")].scrollIntoView();
  100.             }
  101.             ]]>
  102.             </xsl:comment>
  103.         </xsl:element>
  104.     </xsl:element>
  105.     <xsl:element name="BODY">
  106.     <xsl:attribute name="oncontextmenu">return false</xsl:attribute>
  107.         <xsl:element name="A">
  108.         <xsl:attribute name="NAME">top</xsl:attribute>        
  109.             <xsl:element name="H3">
  110.                 <xsl:value-of select="*/index/title" />
  111.             </xsl:element>
  112.         </xsl:element>        
  113.         <xsl:element name="DIV">
  114.         <xsl:attribute name="ID">ButtonMenu</xsl:attribute>
  115.             <xsl:for-each select="*/index/alphabet/item">
  116.                 <xsl:element name="BUTTON">
  117.                 <xsl:attribute name="anchorTarget"><xsl:eval>this.text.toLowerCase()</xsl:eval></xsl:attribute>
  118.                 <xsl:attribute name="onclick">ScrollIntoView(),this.blur()</xsl:attribute>
  119.                 <xsl:attribute name="onmouseover">this.style.borderTop='1px solid white',this.style.borderRight='1px solid #808080',this.style.borderBottom='1px solid #808080',this.style.borderLeft='1px solid white'</xsl:attribute>
  120.                 <xsl:attribute name="onmouseout">this.style.border='1px solid #c0c0c0'</xsl:attribute>
  121.                     <xsl:eval>this.text.toUpperCase()</xsl:eval>
  122.                 </xsl:element>
  123.             </xsl:for-each>
  124.         </xsl:element>
  125.         <xsl:for-each select="*/term" order-by="+title">
  126.             <xsl:element name="P">
  127.                 <xsl:element name="SPAN">
  128.                 <xsl:attribute name="STYLE">behavior:url('hcDropDown.htc')"></xsl:attribute>
  129.                 <xsl:attribute name="FieldToToggle"><xsl:eval>GetUniqueID()</xsl:eval></xsl:attribute>
  130.                     <xsl:element name="A">
  131.                     <xsl:attribute name="NAME"><xsl:eval>MakeAnchor(this)</xsl:eval></xsl:attribute>
  132.                         <xsl:element name="IMG">
  133.                         <xsl:attribute name="SRC">bluedrop.gif</xsl:attribute>
  134.                         </xsl:element>
  135.                     </xsl:element>
  136.                     <xsl:value-of select="title" />
  137.                 </xsl:element>
  138.             </xsl:element>
  139.             <xsl:element name="DIV">
  140.             <xsl:attribute name="ID"><xsl:eval>GetUniqueID()</xsl:eval></xsl:attribute>
  141.             <xsl:attribute name="STYLE">
  142.             display                : none;
  143.             padding-right        : 0.5em;
  144.             padding-bottom        : 0.5em;
  145.             padding-left        : 0.5em;
  146.             border                : 2px solid #dcdcdc;
  147.             background-color    : #f7f7ef;
  148.             </xsl:attribute>
  149.                 <xsl:value-of select="definition"/>
  150.                 <xsl:element name="SPAN">
  151.                     <xsl:element name="SPAN">
  152.                     <xsl:attribute name="STYLE">color:blue;cursor:hand</xsl:attribute>
  153.                     <xsl:attribute name="anchorTarget">top</xsl:attribute>
  154.                     <xsl:attribute name="onmouseover">this.style.textDecoration='underline'</xsl:attribute>
  155.                     <xsl:attribute name="onmouseout">this.style.textDecoration='none'</xsl:attribute>
  156.                     <xsl:attribute name="onclick">ScrollIntoView()</xsl:attribute>
  157.                         Back to top
  158.                     </xsl:element>
  159.                     .
  160.                 </xsl:element>
  161.             </xsl:element>
  162.         </xsl:for-each>
  163.     </xsl:element>
  164. </xsl:element>
  165. </xsl:template>
  166. </xsl:stylesheet>
  167.  
  168.