Meeskond "Tact": Difference between revisions
From ICO wiki
Jump to navigationJump to search
Line 140: | Line 140: | ||
===XSLT=== | ===XSLT=== | ||
<source lang="xml"> | <source lang="xml"> | ||
<?xml version="1.0"?> | |||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |||
<xsl:template match="/"> | |||
<html> | |||
<body> | |||
<h1>Kontaktid</h1> | |||
<table border="1"> | |||
<tr> | |||
<th>Profiilipilt</th> | |||
<th>Eesnimi</th> | |||
<th>Perekonnanimi</th> | |||
<th>E-Post (töine)</th> | |||
<th>E-Post (kodune)</th> | |||
<th>Mobiil</th> | |||
<th>Lauatelefon</th> | |||
<th>Aadress</th> | |||
<th>Sotsiaalvõrgustikud</th> | |||
</tr> | |||
<xsl:for-each select="kontaktid/kontakt"> | |||
<tr> | |||
<td> | |||
<img> | |||
<xsl:attribute name="src"> | |||
<xsl:value-of select="pilt" /> | |||
</xsl:attribute> | |||
</img> | |||
</td> | |||
<td><xsl:value-of select="nimi/eesnimi"/></td> | |||
<td><xsl:value-of select="nimi/perenimi"/></td> | |||
<td><xsl:value-of select="epost[@tyyp='too']"/></td> | |||
<td><xsl:value-of select="epost[@tyyp='kodu']"/></td> | |||
<td><xsl:value-of select="telefon[@tyyp='mobiil']"/></td> | |||
<td><xsl:value-of select="telefon[@tyyp='tavaline']"/></td> | |||
<td> | |||
<xsl:value-of select="aadress/tanav"/><xsl:text> </xsl:text> | |||
<xsl:value-of select="aadress/nr"/>, | |||
<xsl:value-of select="aadress/asula"/>, <xsl:value-of select="aadress/maakond"/>, | |||
<xsl:value-of select="aadress/riik"/> | |||
</td> | |||
<td> | |||
<table> | |||
<tr> | |||
<td>Messenger: </td><td></td> | |||
</tr> | |||
<tr> | |||
<td>Facebook: </td><td></td> | |||
</tr> | |||
<tr> | |||
<td>Orkut: </td><td></td> | |||
</tr> | |||
<tr> | |||
<td>Skype: </td><td></td> | |||
</tr> | |||
<tr> | |||
<td>Twitter: </td><td></td> | |||
</tr> | |||
</table> | |||
</td> | |||
</tr> | |||
</xsl:for-each> | |||
</table> | |||
</body> | |||
</html> | |||
</xsl:template> | |||
</xsl:stylesheet> | |||
</source> | </source> | ||
== Materjalid == | == Materjalid == |
Revision as of 12:11, 22 February 2011
Teema
Meeskond
- Mihkel Sokk
- Jaak Lehtsalu
- Martin Lensment
XML Failid
XML
<?xml version="1.0" encoding="utf-8"?>
<kontaktid>
<kontakt>
<nimi>
<eesnimi>Jaan</eesnimi>
<perenimi>Igamees</perenimi>
</nimi>
<epost tyyp="too">jaantoo@gmail.com</epost>
<epost tyyp="kodu">jaankodu@gmail.com</epost>
<telefon tyyp="mobiil" peamine="true">5500000</telefon>
<telefon tyyp="tavaline">5000000</telefon>
<aadress>
<nr>4c</nr>
<tanav>Raja</tanav>
<asula>Tallinn</asula>
<maakond>Harjumaa</maakond>
<riik>Eesti</riik>
<indeks>67890</indeks>
</aadress>
<sotsiaalne>
<wlm>jaan@hotmail.com</wlm>
<facebook>http://facebook.com/37289</facebook>
<orkut>http://orkut.com/3289783</orkut>
<skype>jIgamees</skype>
<twitter>http://twitter.com/jIgamees</twitter>
</sotsiaalne>
<pilt>http://profile.ak.fbcdn.net/hprofile-ak-snc4/41629_100000310305025_2955_q.jpg</pilt>
</kontakt>
<kontakt>
<nimi>
<eesnimi>Oskar</eesnimi>
<perenimi>Okas</perenimi>
</nimi>
<epost tyyp="too">oskartoos@gmail.com</epost>
<epost tyyp="kodu">oskarkody@gmail.com</epost>
<telefon tyyp="mobiil" peamine="true">53456545</telefon>
<telefon tyyp="tavaline">52433000</telefon>
<aadress>
<nr>34-2</nr>
<tanav>Tihase</tanav>
<asula>Tallinn</asula>
<maakond>Harjumaa</maakond>
<riik>Eesti</riik>
<indeks>34563</indeks>
</aadress>
<sotsiaalne>
<wlm>oskar@hotmail.com</wlm>
<facebook>http://facebook.com/3242324</facebook>
<orkut>http://orkut.com/455445</orkut>
<skype>oOkas</skype>
<twitter>http://twitter.com/ookas</twitter>
</sotsiaalne>
<pilt>http://profile.ak.fbcdn.net/hprofile-ak-snc4/41629_100000310305025_2955_q.jpg</pilt>
</kontakt>
</kontaktid>
XML Schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="kontaktid">
<xs:complexType>
<xs:sequence>
<xs:element name="kontakt">
<xs:complexType>
<xs:sequence>
<xs:element name="nimi">
<xs:complexType>
<xs:sequence>
<xs:element name="eesnimi" type="xs:string" />
<xs:element name="perenimi" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="epost">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="tyyp" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="telefon">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedInt">
<xs:attribute name="tyyp" type="xs:string" use="required" />
<xs:attribute name="peamine" type="xs:boolean" use="optional" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="aadress">
<xs:complexType>
<xs:sequence>
<xs:element name="nr" type="xs:string" />
<xs:element name="tanav" type="xs:string" />
<xs:element name="asula" type="xs:string" />
<xs:element name="maakond" type="xs:string" />
<xs:element name="riik" type="xs:string" />
<xs:element name="indeks" type="xs:unsignedInt" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sotsiaalne">
<xs:complexType>
<xs:sequence>
<xs:element name="wlm" type="xs:string" />
<xs:element name="facebook" type="xs:string" />
<xs:element name="orkut" type="xs:string" />
<xs:element name="skype" type="xs:string" />
<xs:element name="twitter" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="pilt" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XSLT
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h1>Kontaktid</h1>
<table border="1">
<tr>
<th>Profiilipilt</th>
<th>Eesnimi</th>
<th>Perekonnanimi</th>
<th>E-Post (töine)</th>
<th>E-Post (kodune)</th>
<th>Mobiil</th>
<th>Lauatelefon</th>
<th>Aadress</th>
<th>Sotsiaalvõrgustikud</th>
</tr>
<xsl:for-each select="kontaktid/kontakt">
<tr>
<td>
<img>
<xsl:attribute name="src">
<xsl:value-of select="pilt" />
</xsl:attribute>
</img>
</td>
<td><xsl:value-of select="nimi/eesnimi"/></td>
<td><xsl:value-of select="nimi/perenimi"/></td>
<td><xsl:value-of select="epost[@tyyp='too']"/></td>
<td><xsl:value-of select="epost[@tyyp='kodu']"/></td>
<td><xsl:value-of select="telefon[@tyyp='mobiil']"/></td>
<td><xsl:value-of select="telefon[@tyyp='tavaline']"/></td>
<td>
<xsl:value-of select="aadress/tanav"/><xsl:text> </xsl:text>
<xsl:value-of select="aadress/nr"/>,
<xsl:value-of select="aadress/asula"/>, <xsl:value-of select="aadress/maakond"/>,
<xsl:value-of select="aadress/riik"/>
</td>
<td>
<table>
<tr>
<td>Messenger: </td><td></td>
</tr>
<tr>
<td>Facebook: </td><td></td>
</tr>
<tr>
<td>Orkut: </td><td></td>
</tr>
<tr>
<td>Skype: </td><td></td>
</tr>
<tr>
<td>Twitter: </td><td></td>
</tr>
</table>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Materjalid
http://facebooksdk.codeplex.com/
http://code.google.com/p/google-gdata/
http://linqtotwitter.codeplex.com/
http://code.google.com/p/sqlite-net/
http://msdn.microsoft.com/en-us/library/7hs6sw69.aspx
Logi
22. Veebruar
Algne XML, Schema ja XSLT leht valmis
18. Veebruar
Projekti draft areneb