Mjart

From ICO wiki
Revision as of 00:31, 21 March 2017 by Mhakkine (talk | contribs)
Jump to navigationJump to search

Tere, siia tuleb minu VRII Projekt

Tiimiliikmed : Märt Häkkinen

<?xml version="1.0" encoding="UTF-8"?>
<Vehicles>
  <Motorvehicles description="contains trucks,cars">
    <Motorvehicle id="1" type="multipurpose wheeled vehicle" cost="220000" currency="$" active="true">
      <Name><![CDATA[HMMWV M1025]]></Name>
      <Image_url type="absolute">
        <![CDATA[http://www.cgsociety.org/cgsarchive/newgallerycrits/g20/198120/198120_1269734620_large.jpg]]>
      </Image_url>
    </Motorvehicle>
    <Motorvehicle id="2" type="truck" cost="170000" currency="$" active="true">
      <Name><![CDATA[M939]]></Name>
      <Image_url type="absolute">
        <![CDATA[https://upload.wikimedia.org/wikipedia/commons/6/67/US_Marine_Corps_030224-M-XT622-034_USMC_M923_(6X6)_5-ton_cargo_truck_heads_a_convoy_departing_Camp_Matilda,_Kuwait_crop.jpg]]>
      </Image_url>
    </Motorvehicle>
  </Motorvehicles>
  <Armoured_vehicles description="contains armoured vehicles, such as tanks, anti aircraft weapons systems, AFVs">
    <Armoured_vehicle id="3" type="tank" name="M1A2 ABRAMS" cost="6200000" currency="$" active="true">
      <Name><![CDATA[M1A1 ABRAMS]]></Name>
      <Image_url type="absolute">
        <![CDATA[http://www.military-today.com/tanks/m1a2_abrams.jpg]]>
      </Image_url>
    </Armoured_vehicle>
    <Armoured_vehicle id="4" type="armoured fighting vehicle" cost="4900000" currency="$" active="true">
      <Name><![CDATA[Stryker]]></Name>
      <Image_url type="absolute">
        <![CDATA[https://upload.wikimedia.org/wikipedia/commons/5/51/Stryker_ICV_front_q.jpg]]>
      </Image_url>
    </Armoured_vehicle>
    <Armoured_vehicle id="5" type="self-propelled anti-aircraft weapon system" cost="3500000" currency="$" active="false">
      <Name><![CDATA[M163 VADS]]></Name>
      <Image_url type="absolute">
        <![CDATA[http://afvdb.50megs.com/usa/pics/vadsside.jpg]]>
      </Image_url>
    </Armoured_vehicle>
  </Armoured_vehicles>
  <Watercrafts description="contains ships,boats and submarines">
    <Watercraft id="6" type="destroyer" cost="1200000000" currency="£" active="true">
      <Name><![CDATA[HMS Daring]]></Name>
      <Image_url type="relative">
        <![CDATA[/commons/thumb/c/c9/Royal_Navy_Type_45_Destroyer_HMS_Daring_MOD_45153705.jpg/1280px-Royal_Navy_Type_45_Destroyer_HMS_Daring_MOD_45153705.jpg]]>
      </Image_url>
    </Watercraft>
    <Watercraft id="7" type="submarine" cost="1000000000" currency="£" active="true">
      <Name><![CDATA[HMS Artful]]></Name>
      <Image_url type="absolute">
        <![CDATA[http://blogs.plymouth.ac.uk/dcss/wp-content/uploads/sites/50/2016/03/HMS-Artful-S121.jpg]]>
      </Image_url>
    </Watercraft>
  </Watercrafts>
</Vehicles>
</xs:schema>

<source lang="xml"> <?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></head>
     <body>

Motor Vehicles

    <xsl:for-each select="/Vehicles/Motorvehicles/Motorvehicle">
  • Type of vehicle : <xsl:value-of select="@type"/>

    Name of vehicle : <xsl:value-of select="Name/."/>

                 <xsl:variable name="url" select="ImageUrl"/>
                 <xsl:variable name="urlType" select="ImageUrl/@type"/>            
                 <xsl:if test=" $urlType = 'absolute'">
                   <img>
                     <xsl:attribute name="height">
                       200px
                     </xsl:attribute>
                     <xsl:attribute name="src">
                       <xsl:value-of select="$url"/>
                     </xsl:attribute>
                   </img>
                 </xsl:if>
    
  • </xsl:for-each>
     </body>
   </html>
 </xsl:template>

</xsl:stylesheet>