home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 December / PCWorld_2003-12_cd.bin / Software / komercni / alc / ep2sr51csy.msi / Ep.CAB / repx2 < prev    next >
Extensible Markup Language  |  2002-05-22  |  13KB  |  368 lines

  1. <?xml version='1.0' encoding="windows-1250" ?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3.  
  4. <xsl:template match="/">
  5. <xsl:choose>
  6. <xsl:when test=".//node[proplist/prop[kind='Druh']/value='Sestava']">
  7.     <xsl:for-each select=".//node[proplist/prop[kind='Druh']/value='Sestava']" order-by="proplist/prop[kind='Nßzev sestavy']/value">
  8.         <table width="100%"><tr>
  9.             <td>
  10.                 <h1>EvidenΦnφ karta</h1>
  11.                 <img style="cursor:hand" alt="zobrazit/skr²t souΦßsti">
  12.                 <xsl:attribute name="id"><xsl:eval>"partsbutt"+g_repId</xsl:eval></xsl:attribute>
  13.                 <xsl:attribute name="onclick">ToggleBlock("partsbutt","parts",<xsl:eval>g_repId</xsl:eval>)</xsl:attribute>
  14.                 </img>
  15.                 <img style="cursor:hand" alt="zobrazit/skr²t software">
  16.                 <xsl:attribute name="id"><xsl:eval>"softwarebutt"+g_repId</xsl:eval></xsl:attribute>
  17.                 <xsl:attribute name="onclick">ToggleBlock("softwarebutt","software",<xsl:eval>g_repId</xsl:eval>)</xsl:attribute>
  18.                 </img>
  19.                 <img style="cursor:hand" alt="zobrazit/skr²t poznßmky">
  20.                 <xsl:attribute name="id"><xsl:eval>"noticesbutt"+g_repId</xsl:eval></xsl:attribute>
  21.                 <xsl:attribute name="onclick">ToggleBlock("noticesbutt","notices",<xsl:eval>g_repId</xsl:eval>)</xsl:attribute>
  22.                 </img>
  23.             </td>
  24.             <td>
  25.             Nßzev sestavy:<br/>
  26.             <font size="+2"><b><xsl:value-of select="proplist/prop[kind='Nßzev sestavy']/value"/></b></font><br/>
  27.             </td>
  28.             <xsl:if test="proplist/prop[kind='Inventßrnφ Φφslo']/value">
  29.                 <td>
  30.                 Inv.Φφslo sestavy:<br/>
  31.                 <font size="+2"><b><xsl:value-of select="proplist/prop[kind='Inventßrnφ Φφslo']/value"/></b></font><br/>
  32.                 </td>
  33.             </xsl:if>
  34.             <xsl:if test=".//node[proplist/prop[kind='Druh']/value='PoΦφtaΦ']/proplist/prop[kind='Inventßrnφ Φφslo']/value">
  35.                 <td>
  36.                 Inv.Φφslo poΦφtaΦe:<br/>
  37.                 <font size="+2"><b><xsl:value-of select=".//node[proplist/prop[kind='Druh']/value='PoΦφtaΦ']/proplist/prop[kind='Inventßrnφ Φφslo']/value"/></b></font><br/>
  38.                 </td>
  39.             </xsl:if>
  40.         </tr></table>
  41.         
  42.         <xsl:eval>g_BoldProp=true,""</xsl:eval>
  43.         <table class="Frame" width="100%" border="1" cellpadding="5" cellspacing="0" frame="box">
  44.             <tr>
  45.                 <td class="Frame" valign="top" width="50%">
  46.                     <table cellspacing="0" cellpadding="0">
  47.                     <xsl:if test="proplist/prop[kind='Nßzev organizace']">
  48.                         <tr><td><b>Organizace:</b> <xsl:value-of select="proplist/prop[kind='Nßzev organizace']/value"/></td></tr>
  49.                     </xsl:if>
  50.                     <xsl:apply-templates select="proplist/prop[kind='Zßvod']"/>
  51.                     <xsl:apply-templates select="proplist/prop[kind='Zßvod1']"/>
  52.                     <xsl:apply-templates select="proplist/prop[kind='Zßvod2']"/>
  53.                     <xsl:apply-templates select="proplist/prop[kind='Zßvod3']"/>
  54.                     <xsl:apply-templates select="proplist/prop[kind='┌sek']"/>
  55.                     <xsl:apply-templates select="proplist/prop[kind='┌sek1']"/>
  56.                     <xsl:apply-templates select="proplist/prop[kind='┌sek2']"/>
  57.                     <xsl:apply-templates select="proplist/prop[kind='┌sek3']"/>
  58.                     <xsl:apply-templates select="proplist/prop[kind='St°edisko']"/>
  59.                     <xsl:apply-templates select="proplist/prop[kind='St°edisko1']"/>
  60.                     <xsl:apply-templates select="proplist/prop[kind='St°edisko2']"/>
  61.                     <xsl:apply-templates select="proplist/prop[kind='St°edisko3']"/>
  62.                     <xsl:apply-templates select="proplist/prop[kind='┌tvar']"/>
  63.                     <xsl:apply-templates select="proplist/prop[kind='┌tvar1']"/>
  64.                     <xsl:apply-templates select="proplist/prop[kind='┌tvar2']"/>
  65.                     <xsl:apply-templates select="proplist/prop[kind='┌tvar3']"/>
  66.                     <xsl:apply-templates select="proplist/prop[kind='Odd∞lenφ']"/>
  67.                     <xsl:apply-templates select="proplist/prop[kind='U₧ivatel']"/>
  68.                     <xsl:apply-templates select="proplist/prop[kind='Budova']"/>
  69.                     <xsl:apply-templates select="proplist/prop[kind='Poschodφ']"/>
  70.                     <xsl:apply-templates select="proplist/prop[kind='Mφstnost']"/>
  71.                     <xsl:apply-templates select="proplist/prop[kind='Umφst∞nφ']"/>
  72.                     <xsl:apply-templates select="proplist/prop[kind='Nßzev sφt∞']"/>
  73.                     <xsl:apply-templates select="proplist/prop[kind='Nßzev podsφt∞']"/>
  74.                     <xsl:apply-templates select="proplist/prop[kind='Nßzev v∞tve sφt∞']"/>
  75.                     </table>
  76.                 </td>
  77.                 <td class="Frame" valign="top" width="50%">
  78.                     <table cellspacing="0" cellpadding="0">
  79.                     <xsl:for-each select=".//node[proplist/prop[kind='Druh']/value='PoΦφtaΦ']">
  80.                     <xsl:apply-templates select="proplist/prop[kind='Dodavatel']"/>
  81.                     <xsl:apply-templates select="proplist/prop[kind='Datum nßkupu']"/>
  82.                     <xsl:apply-templates select="proplist/prop[kind='╚φslo faktury']"/>
  83.                     <xsl:apply-templates select="proplist/prop[kind='Zßruka']"/>
  84.                     <xsl:apply-templates select="proplist/prop[kind='Cena']"/>
  85.                     </xsl:for-each>
  86.                     </table>
  87.                 </td>
  88.             </tr>
  89.             <tr>
  90.                 <td class="Frame" valign="top">
  91.                     <table cellspacing="0" cellpadding="0">
  92.                     <xsl:for-each select=".//node[proplist/prop[kind='Druh']/value='PoΦφtaΦ']">
  93.                     <xsl:apply-templates select="proplist/prop[kind='Popis']"/>
  94.                     <xsl:apply-templates select="proplist/prop[kind='V²robce']"/>
  95.                     <xsl:apply-templates select="proplist/prop[kind='TypovΘ oznaΦenφ']"/>
  96.                     <xsl:apply-templates select="proplist/prop[kind='SΘriovΘ Φφslo']"/>
  97.                     <xsl:apply-templates select="proplist/prop[kind='Datum p°φÜtφ servisnφ kontroly']"/>
  98.                     </xsl:for-each>
  99.                     </table>
  100.                 </td>
  101.                 <td class="Frame" valign="top" width="50%">
  102.                     <table cellspacing="0" cellpadding="0">
  103.                     <xsl:for-each select=".//node[proplist/prop[kind='Druh']/value='PoΦφtaΦ']">
  104.                     <xsl:for-each select="proplist/prop[not(special) and own]" order-by="kind">
  105.                         <xsl:if expr="GetPropGroup(this)==0">
  106.                             <xsl:apply-templates select="."/>
  107.                         </xsl:if>
  108.                     </xsl:for-each>
  109.                     </xsl:for-each>
  110.                     </table>
  111.                 </td>
  112.             </tr>
  113.         </table>
  114.         <xsl:eval>g_BoldProp=false,""</xsl:eval>
  115.  
  116.         <br/>
  117.  
  118.  
  119.         <table>
  120.         <xsl:attribute name="id"><xsl:eval>"parts"+g_repId</xsl:eval></xsl:attribute>
  121.         <tr><td>
  122.         <h3>
  123.         SouΦßsti
  124.         <img id="closebutt" style="cursor:hand">
  125.         <xsl:attribute name="onclick">ToggleBlock("partsbutt","parts",<xsl:eval>g_repId</xsl:eval>)</xsl:attribute>
  126.         </img>
  127.         </h3>
  128.         <xsl:apply-templates select="nodelist"/>
  129.         </td></tr></table>
  130.  
  131.         <table>
  132.         <xsl:attribute name="id"><xsl:eval>"software"+g_repId</xsl:eval></xsl:attribute>
  133.         <tr><td>
  134.         <h3>Software
  135.         <img id="closebutt" style="cursor:hand">
  136.         <xsl:attribute name="onclick">ToggleBlock("softwarebutt","software",<xsl:eval>g_repId</xsl:eval>)</xsl:attribute>
  137.         </img>
  138.         </h3>
  139.         <xsl:apply-templates select=".//swlist"/>
  140.         </td></tr></table>
  141.  
  142.         <table>
  143.         <xsl:attribute name="id"><xsl:eval>"notices"+g_repId</xsl:eval></xsl:attribute>
  144.         <tr><td>
  145.         <h3>
  146.         Poznßmky
  147.         <img id="closebutt" style="cursor:hand">
  148.         <xsl:attribute name="onclick">ToggleBlock("noticesbutt","notices",<xsl:eval>g_repId</xsl:eval>)</xsl:attribute>
  149.         </img>
  150.         </h3>
  151.         <xsl:for-each select="proplist/prop[kind='Poznßmka']">
  152.             <xsl:value-of select="value"/><br/>
  153.         </xsl:for-each>
  154.         <xsl:apply-templates select="noticelist/notice" order-by="date"/>
  155.         </td></tr></table>
  156.  
  157.         <xsl:if test="context()[not(end())]"><p class="page"></p></xsl:if>
  158.         <xsl:eval>g_repId++,""</xsl:eval>
  159.     </xsl:for-each>
  160. </xsl:when>
  161. <xsl:otherwise>
  162. Vybran² objekt neobsahuje ₧ßdou poΦφtaΦovou Sestavu.
  163. </xsl:otherwise>
  164. </xsl:choose>
  165. </xsl:template>
  166.  
  167. <xsl:template match="nodelist">
  168.     <table width="100%" cellspacing="0">
  169.     <tbody>
  170.         <xsl:for-each select="node" order-by="proplist/prop[kind='Druh']/value">
  171.             <xsl:if expr="TestNode(this)==0">
  172.                 <xsl:apply-templates select="." />
  173.             </xsl:if>
  174.         </xsl:for-each>
  175.     </tbody>
  176.     </table>
  177. </xsl:template>
  178.  
  179. <xsl:template match="prop">
  180.     <tr>
  181.         <td>
  182.         <xsl:choose>
  183.         <xsl:when expr="g_BoldProp">
  184.             <b><xsl:value-of select="kind"/>:</b> <xsl:value-of select="value"/>
  185.         </xsl:when>
  186.         <xsl:otherwise>
  187.             <xsl:value-of select="kind"/>: <xsl:value-of select="value"/>
  188.         </xsl:otherwise>
  189.         </xsl:choose>
  190.         </td>
  191.     </tr>
  192. </xsl:template>
  193.  
  194. <xsl:template match="proplist">
  195.     <xsl:choose>
  196.     <xsl:when test="prop[own='1' and not(special) and not(objectname)]">
  197.         <table cellspacing="0" cellpadding="0"><tbody>
  198.             <tr>
  199.                 <td>
  200.                     <b><xsl:value-of select="prop[kind='Druh']/value"/>:
  201.                     <xsl:value-of select="ancestor(node)/name"/></b>
  202.                 </td>
  203.                 <td align="right" valign="bottom">
  204.                      
  205.                     <img id="togglepropclosed" onclick="ToggleProp(this)"
  206.                      style="cursor:hand" alt="zobrazit/skr²t vlastnosti"/>
  207.                 </td>
  208.             </tr>
  209.             <tr style="display:none">
  210.                 <td colspan="2" valign="top">
  211.                     <table width="100%" cellspacing="0" cellpadding="0"><tbody>
  212.                         <xsl:for-each select="prop[own='1' and not(special) and not(objectname)]" order-by="kind">
  213.                             <xsl:apply-templates select="."/>
  214.                         </xsl:for-each>
  215.                     </tbody></table>
  216.                 </td>
  217.             </tr>
  218.         </tbody></table>
  219.     </xsl:when>
  220.     <xsl:otherwise>
  221.         <table cellspacing="0" cellpadding="0"><tbody>
  222.             <tr>
  223.                 <td>
  224.                     <b><xsl:value-of select="prop[kind='Druh']/value"/>:
  225.                     <xsl:value-of select="ancestor(node)/name"/></b>
  226.                 </td>
  227.             </tr>
  228.         </tbody></table>
  229.     </xsl:otherwise>
  230.     </xsl:choose>
  231. </xsl:template>
  232.  
  233. <xsl:template match="proplist[prop[kind='Druh']/value='PoΦφtaΦ']">
  234.     <xsl:choose>
  235.     <xsl:when test="prop[own='1' and not(special) and not(objectname)]">
  236.         <table cellspacing="0" cellpadding="0" bgcolor="#F0F0F0"><tbody>
  237.             <tr>
  238.                 <td>
  239.                     <b><xsl:value-of select="prop[kind='Druh']/value"/>:
  240.                     <xsl:value-of select="ancestor(node)/name"/></b>
  241.                 </td>
  242.                 <td align="right" valign="bottom">
  243.                      
  244.                     <img id="toggleprop" onclick="ToggleProp(this)"
  245.                      style="cursor:hand" alt="zobrazit/skr²t vlastnosti"/>
  246.                 </td>
  247.             </tr>
  248.             <tr>
  249.                 <td colspan="2" valign="top">
  250.                     <table width="100%" cellspacing="0" cellpadding="0"><tbody>
  251.                         <xsl:for-each select="prop[own='1' and not(special) and not(objectname)]" order-by="kind">
  252.                             <xsl:apply-templates select="."/>
  253.                         </xsl:for-each>
  254.                     </tbody></table>
  255.                 </td>
  256.             </tr>
  257.         </tbody></table>
  258.     </xsl:when>
  259.     <xsl:otherwise>
  260.         <table cellspacing="0" cellpadding="0"><tbody>
  261.             <tr>
  262.                 <td>
  263.                     <b><xsl:value-of select="prop[kind='Druh']/value"/>:
  264.                     <xsl:value-of select="ancestor(node)/name"/></b>
  265.                 </td>
  266.             </tr>
  267.         </tbody></table>
  268.     </xsl:otherwise>
  269.     </xsl:choose>
  270. </xsl:template>
  271.  
  272. <xsl:template match="node">
  273.     <tr>
  274.         <td align="right" valign="top">
  275.         <xsl:choose>
  276.             <xsl:when test="nodelist/node">
  277.                 <img id="toggle" onclick="ToggleNextRow(this)" style="cursor:hand"
  278.                   alt="zobrazit/skr²t podobjekty"/>
  279.             </xsl:when>
  280.             <xsl:otherwise>
  281.                       
  282.             </xsl:otherwise>
  283.         </xsl:choose>
  284.         </td>
  285.         <td valign="top" width="100%">
  286.             <xsl:apply-templates select="proplist"/>
  287.         </td>
  288.     </tr>
  289.     <xsl:if test="nodelist/node">
  290.         <tr>
  291.             <td>      </td>
  292.             <td>
  293.                 <xsl:apply-templates select="nodelist"/>
  294.             </td>
  295.         </tr>
  296.     </xsl:if>
  297. </xsl:template>
  298.  
  299.  
  300. <xsl:template match="swlist">
  301.     <table border="0" cellspacing="0" cellpadding="2">
  302.       <tr>
  303.         <td><b>OperaΦnφ systΘm:</b> <xsl:value-of select="./sw[@cat='1']"/></td>
  304.       </tr>
  305.       <tr>
  306.         <td><b>Aplikace:</b>
  307.           <xsl:for-each select="./sw[@cat!='1']">
  308.             <xsl:value-of select="."/><xsl:if test="context()[not(end())]">, </xsl:if>
  309.           </xsl:for-each>
  310.         </td>
  311.       </tr>
  312.     </table>
  313. </xsl:template>
  314.  
  315.  
  316. <xsl:template match="notice">
  317.     <xsl:value-of select="desc"/>
  318.     (<xsl:value-of select="date"/>, <xsl:value-of select="user"/>)
  319.     <br/>
  320. </xsl:template>
  321.  
  322. <xsl:script><![CDATA[
  323.  
  324. var g_BoldProp=false;
  325. var g_repId=0;
  326.  
  327. function GetPropGroup(e) {
  328.     var a=new Array(
  329.      "Nßzev organizace",
  330.      "Zßvod", "Zßvod1", "Zßvod2", "Zßvod3",
  331.      "┌sek", "┌sek1", "┌sek2", "┌sek3", 
  332.      "St°edisko", "St°edisko1", "St°edisko2", "St°edisko3",
  333.      "┌tvar", "┌tvar1", "┌tvar2", "┌tvar3", 
  334.      "Odd∞lenφ", "U₧ivatel",
  335.      "Budova","Poschodφ","Mφstnost","Umφst∞nφ",
  336.      "Nßzev sφt∞","Nßzev podsφt∞","Nßzev v∞tve sφt∞",
  337.  
  338.      "Dodavatel","Datum nßkupu","╚φslo faktury","Zßruka","Cena",
  339.  
  340.      "Popis","V²robce","TypovΘ oznaΦenφ","SΘriovΘ Φφslo","Datum p°φÜtφ servisnφ kontroly",
  341.  
  342.      "Druh", "Heslo", "P°ihlaÜovacφ jmΘno", "K≤d organizace",
  343.      "Poznßmka", "Nßzev sestavy", "Inventßrnφ Φφslo");
  344.     p=e.selectSingleNode("kind");
  345.     if ( !p )
  346.         return 0;
  347.     for ( i=0; i<a.length; i++ ) {
  348.         if ( p.text.toLowerCase()==a[i].toLowerCase() )
  349.             return 1;
  350.     }
  351.     return 0;
  352. }
  353.  
  354. function TestNode(e) {
  355.     var a=new Array("Seznam instalovanΘho software");
  356.     p=e.selectSingleNode("proplist/prop[kind='Druh']/value");
  357.     if ( !p )
  358.         return 0;
  359.     for ( i=0; i<a.length; i++ ) {
  360.         if ( p.text==a[i] )
  361.             return 1;
  362.     }
  363.     return 0;
  364. }
  365.  
  366. ]]></xsl:script>
  367.  
  368. </xsl:stylesheet>