MRPD

From ICO wiki
Revision as of 13:31, 10 March 2014 by Mbirk (talk | contribs) (→‎Skeemifail)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Projekti kirjeldus

Analüüs

Millega on tegemist?

XML andmefail

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfArvutiKlass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ArvutiKlass UkseNumber="410D" Korrus="4" ArvuteidKlassis="2">
    <Arvutid>
      <Arvuti Name="I5 8gb standard ITK">
        <Cpu ClockMeasure="MhZ" ProductName="i5-2770" Is64BitArchitecture="true" L2Cache="6" L2CacheMeasure="MB">2500</Cpu>
        <Ram TotalSize="8192" Manufacturer="RamFactory">
          <MemorySlots>
            <MemorySlot IsInUse="true" Slot="Slot1" Speed="1333" SpeedMeasure="MhZ">4096</MemorySlot>
            <MemorySlot IsInUse="true" Slot="Slot2" Speed="1333" SpeedMeasure="MhZ">4096</MemorySlot>
            <MemorySlot IsInUse="false" Speed="0">0</MemorySlot>
            <MemorySlot IsInUse="false" Speed="0">0</MemorySlot>
          </MemorySlots>
        </Ram>
        <Hdds>
          <Storage Size="400" SizeMeasure="GB" IsSSD="false" />
          <Storage Size="120" SizeMeasure="GB" IsSSD="true" />
        </Hdds>
      </Arvuti>
      <Arvuti Name="I5 8gb standard ITK">
        <Cpu ClockMeasure="MhZ" ProductName="i5-2770" Is64BitArchitecture="true" L2Cache="6" L2CacheMeasure="MB">2500</Cpu>
        <Ram TotalSize="8192" Manufacturer="RamFactory">
          <MemorySlots>
            <MemorySlot IsInUse="true" Slot="Slot1" Speed="1333" SpeedMeasure="MhZ">4096</MemorySlot>
            <MemorySlot IsInUse="true" Slot="Slot2" Speed="1333" SpeedMeasure="MhZ">4096</MemorySlot>
            <MemorySlot IsInUse="false" Speed="0">0</MemorySlot>
            <MemorySlot IsInUse="false" Speed="0">0</MemorySlot>
          </MemorySlots>
        </Ram>
        <Hdds>
          <Storage Size="400" SizeMeasure="GB" IsSSD="false" />
          <Storage Size="120" SizeMeasure="GB" IsSSD="true" />
        </Hdds>
      </Arvuti>
    </Arvutid>
  </ArvutiKlass>
  <ArvutiKlass UkseNumber="415" Korrus="4" ArvuteidKlassis="1">
    <Arvutid>
      <Arvuti Name="CiscoLab Vana Raal">
        <Cpu ClockMeasure="MhZ" ProductName="Intel Celeron" Is64BitArchitecture="false" L2Cache="2" L2CacheMeasure="MB">1900</Cpu>
        <Ram TotalSize="4096" Manufacturer="RamFactory">
          <MemorySlots>
            <MemorySlot IsInUse="true" Slot="Slot1" Speed="1333" SpeedMeasure="MhZ">2048</MemorySlot>
            <MemorySlot IsInUse="true" Slot="Slot2" Speed="1333" SpeedMeasure="MhZ">2048</MemorySlot>
          </MemorySlots>
        </Ram>
        <Hdds>
          <Storage Size="200" SizeMeasure="Gb" IsSSD="false" />
        </Hdds>
      </Arvuti>
    </Arvutid>
  </ArvutiKlass>
  <ArvutiKlass UkseNumber="320f" Korrus="3" ArvuteidKlassis="1">
    <Arvutid>
      <Arvuti Name="ITK Mac">
        <Cpu ClockMeasure="MhZ" Is64BitArchitecture="true" L2Cache="6" L2CacheMeasure="MB">2300</Cpu>
        <Ram TotalSize="4096" Manufacturer="MacRam Factory">
          <MemorySlots>
            <MemorySlot IsInUse="true" Slot="Slot1" Speed="800" SpeedMeasure="MhZ">4096</MemorySlot>
            <MemorySlot IsInUse="false" Speed="0">0</MemorySlot>
          </MemorySlots>
        </Ram>
        <Hdds>
          <Storage Size="300" SizeMeasure="GB" IsSSD="true" />
        </Hdds>
      </Arvuti>
    </Arvutid>
  </ArvutiKlass>
</ArrayOfArvutiKlass>

Skeemifail

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
  <xsd:element name="ArrayOfArvutiKlass">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element maxOccurs="unbounded" name="ArvutiKlass">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Arvutid">
                <xsd:complexType>
                  <xsd:sequence>
                    <xsd:element maxOccurs="unbounded" name="Arvuti">
                      <xsd:complexType>
                        <xsd:sequence>
                          <xsd:element name="Cpu">
                            <xsd:complexType>
                              <xsd:simpleContent>
                                <xsd:extension base="xsd:unsignedShort">
                                  <xsd:attribute name="ClockMeasure" type="xsd:string" use="required" />
                                  <xsd:attribute name="ProductName" type="xsd:string" use="optional" />
                                  <xsd:attribute name="Is64BitArchitecture" type="xsd:boolean" use="required" />
                                  <xsd:attribute name="L2Cache" type="xsd:unsignedInt" use="required" />
                                  <xsd:attribute name="L2CacheMeasure" type="xsd:string" use="required" />
                                </xsd:extension>
                              </xsd:simpleContent>
                            </xsd:complexType>
                          </xsd:element>
                          <xsd:element name="Ram">
                            <xsd:complexType>
                              <xsd:sequence>
                                <xsd:element name="MemorySlots">
                                  <xsd:complexType>
                                    <xsd:sequence>
                                      <xsd:element maxOccurs="unbounded" name="MemorySlot">
                                        <xsd:complexType>
                                          <xsd:simpleContent>
                                            <xsd:extension base="xsd:unsignedShort">
                                              <xsd:attribute name="IsInUse" type="xsd:boolean" use="required" />
                                              <xsd:attribute name="Slot" type="xsd:string" use="optional" />
                                              <xsd:attribute name="Speed" type="xsd:unsignedShort" use="required" />
                                              <xsd:attribute name="SpeedMeasure" type="xsd:string" use="optional" />
                                            </xsd:extension>
                                          </xsd:simpleContent>
                                        </xsd:complexType>
                                      </xsd:element>
                                    </xsd:sequence>
                                  </xsd:complexType>
                                </xsd:element>
                              </xsd:sequence>
                              <xsd:attribute name="TotalSize" type="xsd:unsignedLong" use="required" />
                              <xsd:attribute name="Manufacturer" type="xsd:string" use="required" />
                            </xsd:complexType>
                          </xsd:element>
                          <xsd:element name="Hdds">
                            <xsd:complexType>
                              <xsd:sequence>
                                <xsd:element maxOccurs="unbounded" name="Storage">
                                  <xsd:complexType>
                                    <xsd:attribute name="Size" type="xsd:unsignedInt" use="required" />
                                    <xsd:attribute name="SizeMeasure" type="xsd:string" use="required" />
                                    <xsd:attribute name="IsSSD" type="xsd:boolean" use="required" />
                                  </xsd:complexType>
                                </xsd:element>
                              </xsd:sequence>
                            </xsd:complexType>
                          </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="Name" type="xsd:string" use="required" />
                      </xsd:complexType>
                    </xsd:element>
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
            <xsd:attribute name="UkseNumber" type="xsd:string" use="required" />
            <xsd:attribute name="Korrus" type="xsd:unsignedByte" use="required" />
            <xsd:attribute name="ArvuteidKlassis" type="xsd:unsignedByte" use="required" />
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xs:schema>

XSL väljundid

Kõik arvutid koos parameetritega

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="html" indent="yes"/>

  <xsl:template match="/">
    <html>
      <head>
        <title>Arvutiklass</title>
      </head>
      <body>
        <h1>Arvutiklassid</h1>

        <table border="1">
          <tr align="left">
            <xsl:for-each select="*/*[1]">
              <th>
                <h3>
                  <xsl:value-of select="name(.)" />
                </h3>
              </th>
              <td>
                <h3>
                  <xsl:value-of select="@UkseNumber" />
                 </h3>
              </td>
              <tr>
                <td>
                  <h3>
                    <p> Arvuteid kokku:</p>
                  </h3>
                  <td>
                    <h3>
                      <xsl:value-of select="@ArvuteidKlassis" />
                    </h3>
                  </td>
                </td>
              </tr>
            </xsl:for-each>
          </tr>

          <!-- Siin läheb Arvuti tagi -->
          <tr align="left">
            <xsl:for-each select="*/*[1]/*[1]/*">
              <tr align="left">
                <td align="left">
                  <b>
                    <xsl:value-of select="@Name" />
                    </b>
                </td>
              </tr>
          
              <!-- Siin läheb CPU, RAM, HDDS tagi -->
              <xsl:for-each select="*">
                <tr align="left">
                  <td  align="left">
                    <xsl:value-of select="name(.)" />
                  </td>          
                  <td align="left">
                    <xsl:value-of select="text()" />
                  </td>
                
                  <!-- Siin CPU, RAM, HDDS atribuudid -->
                  <xsl:for-each select="@*">
                    <tr align="left">
                      <td  align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                  </xsl:for-each>

                  <!-- Siin läheb Memoryslots, storage tagi -->
                  <xsl:for-each select="*/*">
                    <tr align="left">
                      <td align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                    <xsl:for-each select="@*">
                      <tr align="left">
                        <td align="left">
                          <td align="left">
                            <td align="left">
                              <xsl:value-of select="name()"/>
                              <td align="left">
                                <xsl:value-of select="." />
                              </td>
                            </td>
                          </td>
                        </td>
                      </tr>
                    </xsl:for-each>
                  </xsl:for-each>

                  <!-- Siin Storage atribuudid -->
                  <xsl:for-each select="*/@*">
                    <tr align="left">
                      <td align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                  </xsl:for-each>    
                </tr>
              </xsl:for-each>
            </xsl:for-each>
          </tr>
        </table>
              
          <!-- CISCO KLASS -->
         <table border="1">
          <tr align="left">
            <xsl:for-each select="*/*[2]">
              <th>
                <h3>
                  <xsl:value-of select="name(.)" />
                </h3>
              </th>
              <td>
                <h3>
                  <xsl:value-of select="@UkseNumber" />
                 </h3>
              </td>
              <tr>
                <td>
                  <h3>
                    <p> Arvuteid kokku:</p>
                  </h3>
                  <td>
                    <h3>
                      <xsl:value-of select="@ArvuteidKlassis" />
                    </h3>
                  </td>
                </td>
              </tr>
            </xsl:for-each>
          </tr>

          <!-- Siin läheb Arvuti tagi -->
          <tr align="left">
            <xsl:for-each select="*/*[2]/*[1]/*">
              <tr align="left">
                <td align="left">
                  <b>
                    <xsl:value-of select="@Name" />
                    </b>
                </td>
              </tr>
          
              <!-- Siin läheb CPU, RAM, HDDS tagi -->
              <xsl:for-each select="*">
                <tr align="left">
                  <td  align="left">
                    <xsl:value-of select="name(.)" />
                  </td>            
                  <td align="left">
                    <xsl:value-of select="text()" />             
                  </td>
                
                  <!-- Siin CPU, RAM, HDDS atribuudid -->
                  <xsl:for-each select="@*">
                    <tr align="left">
                      <td  align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                  </xsl:for-each>

                  <!-- Siin läheb Memoryslots, storage tagi -->
                  <xsl:for-each select="*/*">
                    <tr align="left">
                      <td align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                    <xsl:for-each select="@*">
                      <tr align="left">
                        <td align="left">
                          <td align="left">
                            <td align="left">
                              <xsl:value-of select="name()"/>
                              <td align="left">
                                <xsl:value-of select="." />
                              </td>
                            </td>
                          </td>
                        </td>
                      </tr>
                    </xsl:for-each>
                  </xsl:for-each>

                  <!-- Siin Storage atribuudid -->
                  <xsl:for-each select="*/@*">
                    <tr align="left">
                      <td align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                  </xsl:for-each>
                
                </tr>
              </xsl:for-each>
            </xsl:for-each>
          </tr>
        </table>
           
          <!-- MAC KLASS -->
         <table border ="2">
          <tr align="left">
            <xsl:for-each select="*/*[3]">
              <th>
                <h3>
                  <xsl:value-of select="name(.)" />
                </h3>
              </th>
              <td>
                <h3>
                  <xsl:value-of select="@UkseNumber" />
                 </h3>
              </td>
              <tr>
                <td>
                  <h3>
                    <p> Arvuteid kokku:</p>
                  </h3>
                  <td>
                    <h3>
                      <xsl:value-of select="@ArvuteidKlassis" />
                    </h3>
                  </td>
                </td>
              </tr>
            </xsl:for-each>
          </tr>

          <!-- Siin läheb Arvuti tagi -->
          <tr align="left">
            <xsl:for-each select="*/*[3]/*[1]/*">
              <tr align="left">
                <td align="left">
                  <b>
                    <xsl:value-of select="@Name" />
                    </b>
                </td>
              </tr>
          
              <!-- Siin läheb CPU, RAM, HDDS tagi -->
              <xsl:for-each select="*">
                <tr align="left">
                  <td  align="left">
                    <xsl:value-of select="name(.)" />
                  </td>
                  <td align="left">
                    <xsl:value-of select="text()" />
                  </td>

                  <!-- Siin CPU, RAM, HDDS atribuudid -->
                  <xsl:for-each select="@*">
                    <tr align="left">
                      <td  align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                  </xsl:for-each>

                  <!-- Siin läheb Memoryslots, storage tagi -->
                  <xsl:for-each select="*/*">
                    <tr align="left">
                      <td align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                    <xsl:for-each select="@*">
                      <tr align="left">
                        <td align="left">
                          <td align="left">
                            <td align="left">
                              <xsl:value-of select="name()"/>
                              <td align="left">
                                <xsl:value-of select="." />
                              </td>
                            </td>
                          </td>
                        </td>
                      </tr>
                    </xsl:for-each>
                  </xsl:for-each>

                  <!-- Siin Storage atribuudid -->
                  <xsl:for-each select="*/@*">
                    <tr align="left">
                      <td align="left">
                        <td align="left">
                          <xsl:value-of select="name()"/>
                          <td align="left">
                            <xsl:value-of select="." />
                          </td>
                        </td>
                      </td>
                    </tr>
                  </xsl:for-each>             
                </tr>
              </xsl:for-each>
            </xsl:for-each>
          </tr>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

Arvutite sobivuse kontroll WP8 ja iOS arendamiseks

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:output method="html" indent="yes"/>
  <xsl:template match="/">
    <html>
      <head>
        <title>Arvutid</title>
      </head>
      <body>
        <h2>Mobiilirakenduse arendamise voimalused</h2>

        <ul>
          Tingimused:
          <ul>
            <li>WP8 - i5 protsessor, 8GB või rohkem RAM-i, 64bit arhitektuur, OS ei ole määratud</li>
            <li>iOS - Mac, 64 bit arhitektuur</li>
          </ul>
        </ul>
        <ul>
          <!--Classrooms-->
          <xsl:for-each select="/ArrayOfArvutiKlass/ArvutiKlass">
            <xsl:variable name="ValitudArvutiKlass" select="@UkseNumber"/>
            <b>
              <xsl:value-of select="$ValitudArvutiKlass"/>
            </b>
            <xsl:text> (ruumis on: </xsl:text>
            <b>
              <xsl:value-of select="@ArvuteidKlassis"/>
            </b>
            <xsl:variable name="ArvuteidKlassis" select="@ArvuteidKlassis"/>
            <!--Choosing between singular or plural end for sentece-->
            <xsl:choose>
              <xsl:when test="$ArvuteidKlassis = 1">
                <xsl:text> arvuti)</xsl:text>
              </xsl:when>
              <xsl:otherwise>
                <xsl:text> arvutit)</xsl:text>
              </xsl:otherwise>
            </xsl:choose>
            <!--Selected classroom computers compatibilty table-->
            <table border="1">
              <tr>
                <td>
                  <a>
                    <b>Arvuti</b>
                  </a>
                </td>
                <td>
                  <a>
                    <b>WP8</b>
                  </a>
                </td>
                <td>
                  <a>
                    <b>iOS</b>
                  </a>
                </td>
              </tr>
              <xsl:for-each select="Arvutid/Arvuti">
                <tr>
                  <td>
                    <xsl:value-of select="@Name"/>
                  </td>
                  <td>
                    <xsl:choose>
                      <!--Windows Phone 8 development conditions: if CPU is i5 or i7 and there is 8 or more GB of RAM-->
                      <xsl:when test="(contains(Cpu/@ProductName, 'i5') or contains(Cpu/@ProductName, 'i7')) and Ram/@TotalSize>=8192 and Cpu/@Is64BitArchitecture='true'">
                        <xsl:text> JAH </xsl:text>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:text> EI </xsl:text>
                      </xsl:otherwise>
                    </xsl:choose>
                  </td>
                  <td>
                    <xsl:choose>
                      <!--iOS development conditions: if name contains mac and cpu is 64 bit-->
                      <xsl:when test="contains(@Name,'Mac') and Cpu/@Is64BitArchitecture='true'">
                        <xsl:text> JAH </xsl:text>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:text> EI </xsl:text>
                      </xsl:otherwise>
                    </xsl:choose>
                  </td>
                </tr>
              </xsl:for-each>
            </table>
            <br/>
          </xsl:for-each>
        </ul>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
MRPD
Ülikool: Eesti Infotehnoloogia Kolledž
Tüüp: Võrgurakendused II
Meeskond "MRPD": Margus Birk (projektijuht)
Ranno Maripuu
Piia-Helin Oras
Doris Hallmägi
Juhendaja: Mait Poska