RM: Difference between revisions
From ICO wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 405: | Line 405: | ||
==== 24.03.2013 ==== | ==== 24.03.2013 ==== | ||
*XML fail | *XML fail | ||
==== | ==== 24.03.2013 ==== | ||
*Wiki lehe loomine | *Wiki lehe loomine | ||
[[Category: Võrgurakendused II: hajussüsteemide ehitamine]] | [[Category: Võrgurakendused II: hajussüsteemide ehitamine]] |
Revision as of 16:18, 24 March 2013
Tööjaotus
- Ilja Semjonov
- Kirill Rõžkov
- Konstantin Žavoronkov
XML
XML failis me lõime Top 10 playlist 70,80,90.ndate muusika hitidest.
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="playlists.xslt" ?>
<playlists>
<playlist id="1" name="70's Top 10 Songs" year="1970">
<song id="1" position="1">
<artist>John Lennon</artist>
<title>Imagine</title>
<image href="http://upload.wikimedia.org/wikipedia/en/6/60/JohnlennonImagine.jpg"/>
<video>http://www.youtube.com/v/DCX3ZNDZAwY?hl=en_GB&version=3</video>
<released>11 October 1971</released>
<album>Imagine</album>
<genre>Rock</genre>
</song>
<song id="2" position="2">
<artist> Don McLean</artist>
<title>American Pie</title>
<image href="http://upload.wikimedia.org/wikipedia/en/2/2b/Don_McLean_-_American_Pie.jpg"/>
<video>http://www.youtube.com/v/iMlzfpwJZuc?hl=en_GB&version=3</video>
<released>November 1971</released>
<album>American Pie</album>
<genre>Rock, Folk Rock</genre>
</song>
<song id="3" position="3">
<artist>Gloria Gaynor </artist>
<title>I Will Survive</title>
<image href="http://upload.wikimedia.org/wikipedia/en/7/73/I_Will_Survive_Gloria_Gaynor.jpg"/>
<video>http://www.youtube.com/v/ZBR2G-iI3-I?version=3&hl=en_GB</video>
<released>October 23, 1978</released>
<album>Love Tracks</album>
<genre>Disco</genre>
</song>
<song id="4" position="4">
<artist>The Knack </artist>
<title>My Sharona</title>
<image href="http://upload.wikimedia.org/wikipedia/en/5/53/MySharonaCover.jpg"/>
<video>http://www.youtube.com/v/bbr60I0u2Ng?hl=en_GB&version=3</video>
<released>June 1979</released>
<album>Get the Knack</album>
<genre>New Wave, Power Pop</genre>
</song>
<song id="5" position="5">
<artist>Queen</artist>
<title>The Rainbow Connection</title>
<image href="http://upload.wikimedia.org/wikipedia/ru/9/9f/Bohemian_Rhapsody.png"/>
<video>http://www.youtube.com/v/fJ9rUzIMcZQ?hl=en_GB&version=3</video>
<released>31 October, 1975</released>
<album>A Night at the Opera</album>
<genre>Rock</genre>
</song>
<song id="6" position="6">
<artist>Johnny Nash</artist>
<title>I Can See Clearly Now</title>
<image href="http://upload.wikimedia.org/wikipedia/en/0/08/I_can_see_clearly_now_%28Johnny_Nash%29.jpg"/>
<video>http://www.youtube.com/v/NkwJ-g0iJ6w?version=3&hl=en_GB</video>
<released>June 23, 1972</released>
<album>Can See Clearly Now</album>
<genre>Pop-Reggae</genre>
</song>
<song id="7" position="7">
<artist>Player</artist>
<title>Baby Come Back</title>
<image href="http://upload.wikimedia.org/wikipedia/en/8/87/Baby_Come_Back%28Single%29.jpg"/>
<video>http://www.youtube.com/v/Hn-enjcgV1o?hl=en_GB&version=3</video>
<released>October 1977</released>
<album>Player</album>
<genre>AOR, Soft rock</genre>
</song>
<song id="8" position="8">
<artist>The Buggles</artist>
<title>Video Killed The Radio Star</title>
<image href="http://upload.wikimedia.org/wikipedia/en/0/04/Video_Killed_the_Radio_Star_single_cover.jpg"/>
<video>http://www.youtube.com/v/W8r-tXRLazs?version=3&hl=en_GB</video>
<released>7 September 1979</released>
<album>The Age of Plastic</album>
<genre>New Wave, synthpop</genre>
</song>
<song id="9" position="9">
<artist>ABBA</artist>
<title>Mamma Mia</title>
<image href="http://upload.wikimedia.org/wikipedia/en/4/48/Mamma_Mia_Intermezzo_No_1.jpg"/>
<video>http://www.youtube.com/v/unfzfe8f9NI?version=3&hl=en_GB</video>
<released>September 1975</released>
<album>ABBA</album>
<genre>Pop Rock</genre>
</song>
<song id="10" position="10">
<artist>Bee Gees</artist>
<title>How Deep Is Your Love</title>
<image href="http://upload.wikimedia.org/wikipedia/en/e/e1/How_Deep_Is_Your_Love.jpg"/>
<video>http://www.youtube.com/v/5XV0G7AtQYw?version=3&hl=en_GB</video>
<released>September 1977</released>
<album>Saturday Night Fever: The Original Movie Sound Track</album>
<genre>Soft Rock</genre>
</song>
</playlist>
<playlist id="2" name="80's Top 10 Songs" year="1980">
<song id="1" position="1">
<artist>Blondie</artist>
<title>Call Me</title>
<image href="http://upload.wikimedia.org/wikipedia/en/9/91/Callmecover.jpg"/>
<video>http://www.youtube.com/v/StKVS0eI85I?version=3&hl=en_GB</video>
<released>February 1, 1980</released>
<album>American Gigolo</album>
<genre>Rock, New Wave</genre>
</song>
<song id="2" position="2">
<artist>Pink Floyd</artist>
<title>Another Brick In The Wall</title>
<image href="http://upload.wikimedia.org/wikipedia/de/f/f8/ABITW2.jpg"/>
<video>http://www.youtube.com/v/YR5ApYxkU-U?hl=en_GB&version=3</video>
<released>30 November 1979 </released>
<album>The Wall</album>
<genre>Progressive Rock</genre>
</song>
<song id="3" position="3">
<artist>Olivia Newton-John</artist>
<title>Magic</title>
<image href="http://upload.wikimedia.org/wikipedia/en/9/9d/Magic_Front.jpg"/>
<video>http://www.youtube.com/v/YM-ogwwGSFA?hl=en_GB&version=3</video>
<released>23 May 1980</released>
<album>Xanadu</album>
<genre>Pop rock</genre>
</song>
<song id="4" position="4">
<artist>Michael Jackson</artist>
<title>Rock with you</title>
<image href="http://upload.wikimedia.org/wikipedia/en/e/ea/Rock_With_You.jpg"/>
<video>http://www.youtube.com/v/5X-Mrc2l1d0?hl=en_GB&version=3</video>
<released>November 3, 1979</released>
<album>Off the Wall</album>
<genre>Disco, pop, soul, funk</genre>
</song>
<song id="5" position="5">
<artist>Captain and Tennille</artist>
<title>Do that to me one more time</title>
<image href="http://upload.wikimedia.org/wikipedia/en/a/aa/Captain_%26_Tennille_-_Do_That_To_Me_One_More_Time_%28single%29.jpg"/>
<video>http://www.youtube.com/v/ry4ngf766N0?hl=en_GB&version=3</video>
<released>1979</released>
<album>Make Your Move</album>
<genre>Pop</genre>
</song>
<song id="6" position="6">
<artist>Queen</artist>
<title>Under Pressure</title>
<image href="http://upload.wikimedia.org/wikipedia/ru/a/af/QueenBowie_UnderPressure.jpg"/>
<video>http://www.youtube.com/v/a01QQZyl-_I?hl=en_GB&version=3</video>
<released>26 October 1981</released>
<album>Hot Space</album>
<genre>Rock</genre>
</song>
<song id="7" position="7">
<artist>Paul McCartney</artist>
<title>Coming Up</title>
<image href="http://upload.wikimedia.org/wikipedia/en/2/2e/McCartneyComingUp.jpg"/>
<video>http://www.youtube.com/v/cDBkySeyiDo?hl=en_GB&version=3</video>
<released>11 April 1980</released>
<album>McCartney II</album>
<genre>Rock</genre>
</song>
<song id="8" position="8">
<artist>Lipps Inc.</artist>
<title>Funkytown</title>
<image href="http://upload.wikimedia.org/wikipedia/en/4/44/LippsIncFunkytown7InchSingleCover.jpg"/>
<video>http://www.youtube.com/v/5CImrIKNmBo?hl=en_GB&version=3</video>
<released>February 18, 1980</released>
<album>Mouth to Mouth</album>
<genre>Disco, synthpop, funk</genre>
</song>
<song id="9" position="9">
<artist>Roxette</artist>
<title>Listen To Your Heart</title>
<image href="http://upload.wikimedia.org/wikipedia/en/9/91/Callmecover.jpg"/>
<video>http://www.youtube.com/v/yCC_b5WHLX0?hl=en_GB&version=3</video>
<released>September 17, 1988</released>
<album>Look Sharp!</album>
<genre>Pop Rock</genre>
</song>
<song id="10" position="10">
<artist>Limahl</artist>
<title>Never Ending Story</title>
<image href="http://upload.wikimedia.org/wikipedia/en/8/8e/The_neverending_story.jpg"/>
<video>http://www.youtube.com/v/3khTntOxX-k?hl=en_GB&version=3</video>
<released>1984</released>
<album>Don't Suppose</album>
<genre>Synthpop, New Wave</genre>
</song>
</playlist>
<playlist id="3" name="90's Top 10 Songs" year="1990">
<song id="1" position="1">
<artist>Nirvana</artist>
<title>Smells Like Teen Spirit</title>
<image href="http://upload.wikimedia.org/wikipedia/en/3/3c/Smells_Like_Teen_Spirit.jpg"/>
<video>http://www.youtube.com/v/hTWKbfoikeg?version=3&hl=en_GB</video>
<released>September 10, 1991</released>
<album>Nevermind</album>
<genre>Grunge</genre>
</song>
<song id="2" position="2">
<artist>U2</artist>
<title>One</title>
<image href="http://upload.wikimedia.org/wikipedia/en/8/86/U2_One.png"/>
<video>http://www.youtube.com/v/ftjEcrrf7r0?hl=en_GB&version=3</video>
<released>6 March 1992</released>
<album>Achtung Baby</album>
<genre>Rock</genre>
</song>
<song id="3" position="3">
<artist>Backstreet Boys</artist>
<title>I Want It That Way</title>
<image href="http://upload.wikimedia.org/wikipedia/en/b/b9/Iwantitthatwaycd.jpg"/>
<video>http://www.youtube.com/v/4fndeDfaWCg?hl=en_GB&version=3</video>
<released>April 12, 1999</released>
<album>Millennium</album>
<genre>Pop</genre>
</song>
<song id="4" position="4">
<artist>Whitney Houston</artist>
<title>I Will Always Love You</title>
<image href="http://upload.wikimedia.org/wikipedia/en/d/d4/I_will_always_love_you.jpg"/>
<video>http://www.youtube.com/v/3JWTaaS7LdU?hl=en_GB&version=3</video>
<released>November 3, 1992</released>
<album> The Bodyguard: Original Soundtrack Album</album>
<genre>Pop</genre>
</song>
<song id="5" position="5">
<artist>Madonna</artist>
<title>Vogue</title>
<image href="http://upload.wikimedia.org/wikipedia/en/4/4f/Vogue_single_cover.jpg"/>
<video>http://www.youtube.com/v/GuJQSAiODqI?hl=en_GB&version=3</video>
<released>March 20, 1990</released>
<album>I'm Breathless</album>
<genre>Dance-Pop</genre>
</song>
<song id="6" position="6">
<artist>Roxette</artist>
<title>Joyride</title>
<image href="http://upload.wikimedia.org/wikipedia/en/b/b2/Roxette_-_Joyride_ablum_coverart.jpg"/>
<video>http://www.youtube.com/v/xCorJG9mubk?hl=en_GB&version=3</video>
<released>28 March 1991</released>
<album>Pearls of Passion</album>
<genre>Dance-rock, power pop</genre>
</song>
<song id="7" position="7">
<artist>R.E.M.</artist>
<title>Losing My Religion </title>
<image href="http://upload.wikimedia.org/wikipedia/en/7/72/R.E.M._-_Losing_My_Religion.jpg"/>
<video>http://www.youtube.com/v/xwtdhWltSIg?hl=en_GB&version=3</video>
<released>February 19, 1991</released>
<album>Out of Time</album>
<genre>Alternative rock</genre>
</song>
<song id="8" position="8">
<artist>Red Hot Chili Peppers</artist>
<title>Under The Bridge</title>
<image href="http://upload.wikimedia.org/wikipedia/en/4/41/UndertheBridge.jpg"/>
<video>http://www.youtube.com/v/lwlogyj7nFE?version=3&hl=en_GB</video>
<released>March 10, 1992</released>
<album>Blood Sugar Sex Magik</album>
<genre>Alternative rock</genre>
</song>
<song id="9" position="9">
<artist>Metallica</artist>
<title>Enter Sandman</title>
<image href="http://upload.wikimedia.org/wikipedia/en/c/c8/Metallica_-_Enter_Sandman_cover.jpg"/>
<video>http://www.youtube.com/v/CD-E-LDc384?version=3&hl=en_GB</video>
<released>July 29, 1991</released>
<album>Metallica</album>
<genre>Heavy metal</genre>
</song>
<song id="10" position="10">
<artist>Take That</artist>
<title>Back For Good </title>
<image href="http://upload.wikimedia.org/wikipedia/en/b/bb/Back_for_good.jpg"/>
<video>http://www.youtube.com/v/N2ICtCO8TCw?hl=en_GB&version=3</video>
<released>27 March 1995</released>
<album>Nobody Else</album>
<genre>Pop</genre>
</song>
</playlist>
</playlists>
XSLT
<?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" omit-xml-declaration="yes"/>
<xsl:template match="/">
<html>
<head>
<title>Old Hits</title>
</head>
<body style="background:#d5d5d5; font-family: Helvetica, Arial, Sans-serif;">
<h1 style="width: 560px; margin: 0 auto;">Old Hits</h1>
<xsl:apply-templates select="playlists/playlist"/>
</body>
</html>
</xsl:template>
<xsl:template match="playlist">
<div style="width: 560px; margin: 0 auto;">
<h2 style="font-weight: normal; margin-top: 60px;"><xsl:value-of select="@name"/></h2>
<xsl:apply-templates select="song"/>
</div>
</xsl:template>
<xsl:template match="song">
<div style="width: 560px;
margin: 0 auto;
margin-bottom: 10px;
padding: 25px 25px 15px;
background: grey">
<div style="float: left; margin-right: 10px">
<img style="width:100px">
<xsl:attribute name="src">
<xsl:value-of select="image/@href"/>
</xsl:attribute>
</img>
</div>
<p style="font-size: 20px; margin: 0">
<xsl:value-of select="@position"/>
<xsl:text>. </xsl:text>
<xsl:value-of select="artist"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="title"/>
</p>
<ul style="list-style:none; margin: 10px 0px 40px 0px; font-size: 16px">
<li>
Released: <xsl:value-of select="released"/>
</li>
<li>
Genre: <xsl:value-of select="genre"/>
</li>
<li>
Album: <xsl:value-of select="album"/>
</li>
</ul>
<iframe width="560" height="315" src="{video}" frameborder="0"></iframe>
</div>
</xsl:template>
</xsl:stylesheet>
Genereeritud XSD
<?xml version="1.0" encoding="cp866"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xml
ns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="playlists">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="playlist">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="song">
<xs:complexType>
<xs:sequence>
<xs:element name="artist" type="xs:string" />
<xs:element name="title" type="xs:string" />
<xs:element name="image">
<xs:complexType>
<xs:attribute name="href" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="video" type="xs:string" />
<xs:element name="released" type="xs:string" />
<xs:element name="album" type="xs:string" />
<xs:element name="genre" type="xs:string" />
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedByte" use="required"/>
<xs:attribute name="position" type="xs:unsignedByte" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:unsignedByte" use="required" />
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="year" type="xs:unsignedShort" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Log
24.03.2013
- XML fail
24.03.2013
- Wiki lehe loomine