Unnamed Team: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Akirotar (talk | contribs)
Akirotar (talk | contribs)
Line 8: Line 8:
== XML / XSD / XSLT==
== XML / XSD / XSLT==


=== XML ===
 
<?xml version="1.0" encoding="utf-8" ?>
 
<?xml version="1.0" encoding="UTF-8"?>
<GameShop>
<GameShop>
  <Genres>
  <Genres>
    <Genre>Action</Genre>
      <Genre>Action</Genre>
    <Genre>RPG</Genre>
      <Genre>RPG</Genre>
    <Genre>Action</Genre>
      <Genre>Action</Genre>
    <Genre>Fantasy</Genre>
      <Genre>Fantasy</Genre>
    <Genre>Sci-fi</Genre>
      <Genre>Sci-fi</Genre>
    <Genre>Horror</Genre>
      <Genre>Horror</Genre>
  </Genres>
  </Genres>
  <Games>
  <Games>
    <Game Title="Fallout4" Year="2016" >
      <Game Title="Fallout4" Year="2016">
      <Genres>
        <Genres>
        <Genre>FPS</Genre>
            <Genre>FPS</Genre>
        <Genre>Action</Genre>
            <Genre>Action</Genre>
        <Genre>Sci-fi</Genre>
            <Genre>Sci-fi</Genre>
      </Genres>
        </Genres>
      <Images>
        <Images>
        <Image>http://cdn.akamai.steamstatic.com/steam/apps/377160/header.jpg?t=1486403180</Image>
            <Image>http://cdn.akamai.steamstatic.com/steam/apps/377160/header.jpg?t=1486403180</Image>
        <Image>http://cdn.akamai.steamstatic.com/steam/apps/377160/header.jpg?t=1486403180</Image>
            <Image>http://cdn.akamai.steamstatic.com/steam/apps/377160/header.jpg?t=1486403180</Image>
      </Images>
        </Images>
      <SystemRequiments RequimentType="Minimum">
        <SystemRequiments RequimentType="Minimum">
        <Oses>
            <Oses>
          <Os Architecture="64bit">Windows 7</Os>
              <Os Architecture="64bit">Windows 7</Os>
          <Os Architecture ="64bit">Windows 10</Os>
              <Os Architecture="64bit">Windows 10</Os>
        </Oses>
            </Oses>
        <Processor>Intel Core i5-2400/AMD FX-8320 or better</Processor>
            <Processor>Intel Core i5-2400/AMD FX-8320 or better</Processor>
        <Memory>4 GB RAM</Memory>
            <Memory>4 GB RAM</Memory>
        <Graphics>NVIDIA GTX 670 2GB/AMD Radeon HD 7870 2GB or better</Graphics>
            <Graphics>NVIDIA GTX 670 2GB/AMD Radeon HD 7870 2GB or better</Graphics>
        <Storage>25 GB available space</Storage>
            <Storage>25 GB available space</Storage>
        <AdditionalNotes>Requires broadband internet connection for Multiplayer</AdditionalNotes>
            <AdditionalNotes>Requires broadband internet connection for Multiplayer</AdditionalNotes>
      </SystemRequiments>
        </SystemRequiments>
      <SystemRequiments RequimentType="Reccomended" >
        <SystemRequiments RequimentType="Reccomended">
        <Os>Windows 7/8.1/10 (64-bit versions)</Os>
            <Os>Windows 7/8.1/10 (64-bit versions)</Os>
        <Processor> Intel Core i7-3770/AMD FX-8350 or better</Processor>
            <Processor>Intel Core i7-3770/AMD FX-8350 or better</Processor>
        <Memory>8 GB RAM</Memory>
            <Memory>8 GB RAM</Memory>
        <Graphics>NVIDIA GTX 970 4GB/AMD Radeon R9 290 4GB or better</Graphics>
            <Graphics>NVIDIA GTX 970 4GB/AMD Radeon R9 290 4GB or better</Graphics>
        <Storage>25 GB available space</Storage>
            <Storage>25 GB available space</Storage>
        <AdditionalNotes>Requires broadband internet connection for Multiplayer</AdditionalNotes>
            <AdditionalNotes>Requires broadband internet connection for Multiplayer</AdditionalNotes>
      </SystemRequiments>
        </SystemRequiments>
    </Game>
      </Game>
    <Game Title="Fallout 3 NewVegas" Year="2016" >
      <Game Title="Fallout 3 NewVegas" Year="2016">
      <Genres>
        <Genres>
        <Genre>FPS</Genre>
            <Genre>FPS</Genre>
        <Genre>Action</Genre>
            <Genre>Action</Genre>
        <Genre>Sci-fi</Genre>
            <Genre>Sci-fi</Genre>
      </Genres>
        </Genres>
      <Images>
        <Images>
        <Image>https://i.kinja-img.com/gawker-media/image/upload/s--dWfA2BXt--/ilz6yicwfquqoyalkwjd.jpg</Image>
            <Image>https://i.kinja-img.com/gawker-media/image/upload/s--dWfA2BXt--/ilz6yicwfquqoyalkwjd.jpg</Image>
      </Images>
        </Images>
      <SystemRequiments RequimentType="Minimum">
        <SystemRequiments RequimentType="Minimum">
        <Oses>
            <Oses>
          <Os Architecture="32bit">Windows xp</Os>
              <Os Architecture="32bit">Windows xp</Os>
          <Os Architecture ="32bit">Windows Vista</Os>
              <Os Architecture="32bit">Windows Vista</Os>
        </Oses>
            </Oses>
        <Processor>2.4 Ghz Intel Pentium 4 or equivalent processor</Processor>
            <Processor>2.4 Ghz Intel Pentium 4 or equivalent processor</Processor>
        <Memory>1 GB (XP)/ 2 GB (Vista) </Memory>
            <Memory>1 GB (XP)/ 2 GB (Vista)</Memory>
        <Graphics>Direct X 9.0c compliant video card with 256MB RAM (NVIDIA 6800 or better/ATI X850 or better) </Graphics>
            <Graphics>Direct X 9.0c compliant video card with 256MB RAM (NVIDIA 6800 or better/ATI X850 or better)</Graphics>
        <Storage>25 GB available space</Storage>
            <Storage>25 GB available space</Storage>
        <AdditionalNotes> Online play requires log-in to Games For Windows - Live</AdditionalNotes>
            <AdditionalNotes>Online play requires log-in to Games For Windows - Live</AdditionalNotes>
      </SystemRequiments>
        </SystemRequiments>
    </Game>
      </Game>
    <Game Title="Dark Souls 3" Year="2016">
      <Game Title="Dark Souls 3" Year="2016">
      <Genres>
        <Genres>
        <Genre>RPG</Genre>
            <Genre>RPG</Genre>
      </Genres>
        </Genres>
      <Images>
        <Images>
        <Image>
            <Image>https://d1r7xvmnymv7kg.cloudfront.net/sites_products/darksouls3/assets/img/DARKSOUL_facebook_mini.jpg</Image>
          https://d1r7xvmnymv7kg.cloudfront.net/sites_products/darksouls3/assets/img/DARKSOUL_facebook_mini.jpg
            <Image>https://cdn2.vox-cdn.com/uploads/chorus_asset/file/6323691/Dark_Souls_3_concept_art.0.jpg</Image>
        </Image>
            <Image>https://i.ytimg.com/vi/Ha8eRiP0DmI/maxresdefault.jpg</Image>
        <Image>
        </Images>
          https://cdn2.vox-cdn.com/uploads/chorus_asset/file/6323691/Dark_Souls_3_concept_art.0.jpg
        <SystemRequiments RequimentType="Minimum">
        </Image>
            <Oses>
        <Image>
              <Os Architecture="32bit">Windows xp</Os>
          https://i.ytimg.com/vi/Ha8eRiP0DmI/maxresdefault.jpg
              <Os Architecture="32bit">Windows Vista</Os>
        </Image>
            </Oses>
      </Images>
            <Os>Windows 7 SP1 64bit, Windows 8.1 64bit Windows 10 64bit</Os>
      <SystemRequiments RequimentType="Minimum">
            <Processor>Intel Core i3-2100 / AMD® FX-6300</Processor>
        <Oses>
            <Memory>4 GB RAM</Memory>
          <Os Architecture="32bit">Windows xp</Os>
            <Graphics>NVIDIA® GeForce GTX 750 Ti / ATI Radeon HD 7950</Graphics>
          <Os Architecture ="32bit">Windows Vista</Os>
            <DirectX>Version 11</DirectX>
        </Oses>
            <Network>Broadband Internet connection</Network>
        <Os>Windows 7 SP1 64bit, Windows 8.1 64bit Windows 10 64bit</Os>
            <Storage>25 GB available space</Storage>
        <Processor>Intel Core i3-2100 / AMD® FX-6300</Processor>
            <SoundCard>DirectX 11 sound device</SoundCard>
        <Memory>4 GB RAM</Memory>
        </SystemRequiments>
        <Graphics>NVIDIA® GeForce GTX 750 Ti / ATI Radeon HD 7950</Graphics>
        <SystemRequiments RequimentType="Recommended">
        <DirectX>Version 11</DirectX>
            <Oses>
        <Network>Broadband Internet connection</Network>
              <Os Architecture="64bit">Windows 7</Os>
        <Storage>25 GB available space</Storage>
              <Os Architecture="64bit">Windows 8.1</Os>
        <SoundCard>DirectX 11 sound device</SoundCard>
              <Os Architecture="64bit">Windows 10</Os>
      </SystemRequiments>
            </Oses>
      <SystemRequiments RequimentType="Recommended">
            <Processor>Intel Core i7-3770 / AMD® FX-8350</Processor>
        <Oses>
            <Memory>8 GB RAM</Memory>
          <Os Architecture="64bit">Windows 7</Os>
            <Graphics>NVIDIA® GeForce GTX 970 / ATI Radeon R9 series</Graphics>
          <Os Architecture ="64bit">Windows 8.1</Os>
            <DirectX>Version 11</DirectX>
          <Os Architecture ="64bit">Windows 10</Os>
            <Network>Broadband Internet connection</Network>
        </Oses>
            <Storage>25 GB</Storage>
        <Processor>Intel Core i7-3770 / AMD® FX-8350</Processor>
            <SoundCard>DirectX 11 sound device</SoundCard>
        <Memory>8 GB RAM </Memory>
        </SystemRequiments>
        <Graphics>NVIDIA® GeForce GTX 970 / ATI Radeon R9 series</Graphics>
      </Game>
        <DirectX>Version 11</DirectX>
  </Games>
        <Network>Broadband Internet connection</Network>
        <Storage>25 GB</Storage>
        <SoundCard>DirectX 11 sound device</SoundCard>
      </SystemRequiments>
    </Game>
  </Games>
</GameShop>
</GameShop>
=== XSD ===
=== XSD ===
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>

Revision as of 18:04, 20 March 2017

Meeskond

  • Andreas Kirotar
  • Jaan Kostõgov

Idee

XML ideeks on arvuti mängude kataloog.

XML / XSD / XSLT

<?xml version="1.0" encoding="UTF-8"?> <GameShop>

  <Genres>
     <Genre>Action</Genre>
     <Genre>RPG</Genre>
     <Genre>Action</Genre>
     <Genre>Fantasy</Genre>
     <Genre>Sci-fi</Genre>
     <Genre>Horror</Genre>
  </Genres>
  <Games>
     <Game Title="Fallout4" Year="2016">
        <Genres>
           <Genre>FPS</Genre>
           <Genre>Action</Genre>
           <Genre>Sci-fi</Genre>
        </Genres>
        <Images>
           <Image>http://cdn.akamai.steamstatic.com/steam/apps/377160/header.jpg?t=1486403180</Image>
           <Image>http://cdn.akamai.steamstatic.com/steam/apps/377160/header.jpg?t=1486403180</Image>
        </Images>
        <SystemRequiments RequimentType="Minimum">
           <Oses>
              <Os Architecture="64bit">Windows 7</Os>
              <Os Architecture="64bit">Windows 10</Os>
           </Oses>
           <Processor>Intel Core i5-2400/AMD FX-8320 or better</Processor>
           <Memory>4 GB RAM</Memory>
           <Graphics>NVIDIA GTX 670 2GB/AMD Radeon HD 7870 2GB or better</Graphics>
           <Storage>25 GB available space</Storage>
           <AdditionalNotes>Requires broadband internet connection for Multiplayer</AdditionalNotes>
        </SystemRequiments>
        <SystemRequiments RequimentType="Reccomended">
           <Os>Windows 7/8.1/10 (64-bit versions)</Os>
           <Processor>Intel Core i7-3770/AMD FX-8350 or better</Processor>
           <Memory>8 GB RAM</Memory>
           <Graphics>NVIDIA GTX 970 4GB/AMD Radeon R9 290 4GB or better</Graphics>
           <Storage>25 GB available space</Storage>
           <AdditionalNotes>Requires broadband internet connection for Multiplayer</AdditionalNotes>
        </SystemRequiments>
     </Game>
     <Game Title="Fallout 3 NewVegas" Year="2016">
        <Genres>
           <Genre>FPS</Genre>
           <Genre>Action</Genre>
           <Genre>Sci-fi</Genre>
        </Genres>
        <Images>
           <Image>https://i.kinja-img.com/gawker-media/image/upload/s--dWfA2BXt--/ilz6yicwfquqoyalkwjd.jpg</Image>
        </Images>
        <SystemRequiments RequimentType="Minimum">
           <Oses>
              <Os Architecture="32bit">Windows xp</Os>
              <Os Architecture="32bit">Windows Vista</Os>
           </Oses>
           <Processor>2.4 Ghz Intel Pentium 4 or equivalent processor</Processor>
           <Memory>1 GB (XP)/ 2 GB (Vista)</Memory>
           <Graphics>Direct X 9.0c compliant video card with 256MB RAM (NVIDIA 6800 or better/ATI X850 or better)</Graphics>
           <Storage>25 GB available space</Storage>
           <AdditionalNotes>Online play requires log-in to Games For Windows - Live</AdditionalNotes>
        </SystemRequiments>
     </Game>
     <Game Title="Dark Souls 3" Year="2016">
        <Genres>
           <Genre>RPG</Genre>
        </Genres>
        <Images>
           <Image>https://d1r7xvmnymv7kg.cloudfront.net/sites_products/darksouls3/assets/img/DARKSOUL_facebook_mini.jpg</Image>
           <Image>https://cdn2.vox-cdn.com/uploads/chorus_asset/file/6323691/Dark_Souls_3_concept_art.0.jpg</Image>
           <Image>https://i.ytimg.com/vi/Ha8eRiP0DmI/maxresdefault.jpg</Image>
        </Images>
        <SystemRequiments RequimentType="Minimum">
           <Oses>
              <Os Architecture="32bit">Windows xp</Os>
              <Os Architecture="32bit">Windows Vista</Os>
           </Oses>
           <Os>Windows 7 SP1 64bit, Windows 8.1 64bit Windows 10 64bit</Os>
           <Processor>Intel Core i3-2100 / AMD® FX-6300</Processor>
           <Memory>4 GB RAM</Memory>
           <Graphics>NVIDIA® GeForce GTX 750 Ti / ATI Radeon HD 7950</Graphics>
           <DirectX>Version 11</DirectX>
           <Network>Broadband Internet connection</Network>
           <Storage>25 GB available space</Storage>
           <SoundCard>DirectX 11 sound device</SoundCard>
        </SystemRequiments>
        <SystemRequiments RequimentType="Recommended">
           <Oses>
              <Os Architecture="64bit">Windows 7</Os>
              <Os Architecture="64bit">Windows 8.1</Os>
              <Os Architecture="64bit">Windows 10</Os>
           </Oses>
           <Processor>Intel Core i7-3770 / AMD® FX-8350</Processor>
           <Memory>8 GB RAM</Memory>
           <Graphics>NVIDIA® GeForce GTX 970 / ATI Radeon R9 series</Graphics>
           <DirectX>Version 11</DirectX>
           <Network>Broadband Internet connection</Network>
           <Storage>25 GB</Storage>
           <SoundCard>DirectX 11 sound device</SoundCard>
        </SystemRequiments>
     </Game>
  </Games>

</GameShop>

XSD

<?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">

 <xs:element name="GameShop">
   <xs:complexType>
     <xs:sequence>
       <xs:element name="Genres">
         <xs:complexType>
           <xs:sequence>
             <xs:element maxOccurs="unbounded" name="Genre" type="xs:string" />
           </xs:sequence>
         </xs:complexType>
       </xs:element>
       <xs:element name="Games">
         <xs:complexType>
           <xs:sequence>
             <xs:element maxOccurs="unbounded" name="Game">
               <xs:complexType>
                 <xs:sequence>
                   <xs:element name="Genres">
                     <xs:complexType>
                       <xs:sequence>
                         <xs:element maxOccurs="unbounded" name="Genre" type="xs:string" />
                       </xs:sequence>
                     </xs:complexType>
                   </xs:element>
                   <xs:element name="Images">
                     <xs:complexType>
                       <xs:sequence>
                         <xs:element maxOccurs="unbounded" name="Image" type="xs:string" />
                       </xs:sequence>
                     </xs:complexType>
                   </xs:element>
                   <xs:element maxOccurs="unbounded" name="SystemRequiments">
                     <xs:complexType>
                       <xs:sequence>
                         <xs:choice maxOccurs="unbounded">
                           <xs:element name="Os" type="xs:string" />
                           <xs:element name="Oses">
                             <xs:complexType>
                               <xs:sequence>
                                 <xs:element maxOccurs="unbounded" name="Os">
                                   <xs:complexType>
                                     <xs:simpleContent>
                                       <xs:extension base="xs:string">
                                         <xs:attribute name="Architecture" type="xs:string" use="required" />
                                       </xs:extension>
                                     </xs:simpleContent>
                                   </xs:complexType>
                                 </xs:element>
                               </xs:sequence>
                             </xs:complexType>
                           </xs:element>
                           <xs:element name="Processor" type="xs:string" />
                           <xs:element name="Memory" type="xs:string" />
                           <xs:element name="Graphics" type="xs:string" />
                           <xs:element name="Storage" type="xs:string" />
                           <xs:element name="AdditionalNotes" type="xs:string" />
                           <xs:element name="DirectX" type="xs:string" />
                           <xs:element name="Network" type="xs:string" />
                           <xs:element name="SoundCard" type="xs:string" />
                         </xs:choice>
                       </xs:sequence>
                       <xs:attribute name="RequimentType" type="xs:string" use="required" />
                     </xs:complexType>
                   </xs:element>
                 </xs:sequence>
                 <xs:attribute name="Title" type="xs:string" use="required" />
                 <xs:attribute name="Year" type="xs:unsignedShort" use="required" />
               </xs:complexType>
             </xs:element>
           </xs:sequence>
         </xs:complexType>
       </xs:element>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

</xs:schema>

XSLT

XSLT (HTML)

<?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>Games by genre(windows 7)</title>
     </head>
     <body>
       <xsl:for-each select="/GameShop/Genres/Genre">
         <xsl:variable name="MainGenre" select="."/>

<xsl:value-of select="$MainGenre"/>

    <xsl:for-each select="/GameShop/Games/Game"> <xsl:if test="(Genres/Genre = $MainGenre) and (SystemRequiments/Oses/Os ='Windows 7')"> <xsl:variable name="Game" select="."/>
  • Name: <xsl:value-of select="./@Title"/>
  • Release year: <xsl:value-of select="./@Year"/>
  • <xsl:for-each select="./Images/Image"> <xsl:variable name="ImageUrl" select="."/> <img src="{$ImageUrl}" width="400" height="200"/> </xsl:for-each>
  • Requirements:
  • Operating systems:<xsl:value-of select="$Game/SystemRequiments/Oses"/>
  • Processor:<xsl:value-of select="$Game/SystemRequiments/Processor"/>
  • Memory:<xsl:value-of select="$Game/SystemRequiments/Memory"/>
  • Graphics card:<xsl:value-of select="$Game/SystemRequiments/Graphics"/>
  • Storage:<xsl:value-of select="$Game/SystemRequiments/Storage"/>
  • Notes:<xsl:value-of select="$Game/SystemRequiments/AdditionalNotes"/>
  • Sound:<xsl:value-of select="$Game/SystemRequiments/SoundCard"/>
  • DirectX:<xsl:value-of select="$Game/SystemRequiments/DirectX"/>
  • </xsl:if> </xsl:for-each>
       </xsl:for-each>
     </body>
   </html>
 </xsl:template>

</xsl:stylesheet>

XSLT (XML)

Log

  • 17.03 Esimene kokkusaamine, XML, XSD, XSLT(HTML) kujul loomine.
  • 20.03 Kaugtööna XSLT(HTML) ja XSLT(XML) lõpetamine, Wiki lehe loomine.