Meeskond "Kolmas" 2012: Difference between revisions
From ICO wiki
Jump to navigationJump to search
Line 3: | Line 3: | ||
* Liikmed: Jevgeni Nesterenko, Jako Heinmets, Lauri Rooden | * Liikmed: Jevgeni Nesterenko, Jako Heinmets, Lauri Rooden | ||
==Idee== | == Idee == | ||
Märkmete jagamise teenus. Leides internetist huvitava veebilehe, saab kasutaja bookmarkletil klikates seda koos kommentaariga sõpradele jagada. | Märkmete jagamise teenus. Leides internetist huvitava veebilehe, saab kasutaja bookmarkletil klikates seda koos kommentaariga sõpradele jagada. | ||
Kasutajad saavad neile jagatud märkmeid sirvida sarnaselt uudistevoole. | Kasutajad saavad neile jagatud märkmeid sirvida sarnaselt uudistevoole. | ||
== XML fail == | |||
<source lang="xml"> | |||
<?xml version="1.0" encoding="utf-8" ?> | |||
<?xml-stylesheet type="text/xsl" href="kolmas.xslt"?> | |||
<notes> | |||
<note> | |||
<id>dcf0e99</id> | |||
<url>https://wiki.itcollege.ee/</url> | |||
<users> | |||
<user> | |||
<time>2012-04-03T15:40</time> | |||
<name>Lauri Rooden</name> | |||
<comment><![CDATA[Kooli wiki]]></comment> | |||
<tags> | |||
<tag>kool</tag> | |||
</tags> | |||
</user> | |||
<user> | |||
<time>2012-04-03T15:41</time> | |||
<name>Jako Heinmets</name> | |||
<comment><![CDATA[ITK wiki]]></comment> | |||
<tags> | |||
<tag>ITK</tag> | |||
<tag>wiki</tag> | |||
</tags> | |||
</user> | |||
</users> | |||
</note> | |||
<note> | |||
<id>25de837</id> | |||
<url>https://wiki.itcollege.ee/index.php/Meeskond_"Kolmas"</url> | |||
<users> | |||
<user> | |||
<time>2012-04-03T15:41</time> | |||
<name>Lauri Rooden</name> | |||
<comment><![CDATA[Kodutoo wikileht]]></comment> | |||
<tags> | |||
<tag>kool</tag> | |||
</tags> | |||
</user> | |||
</users> | |||
</note> | |||
</notes> | |||
</source> | |||
== XSD fail == | |||
<source lang="xml"> | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |||
<xs:element name="notes"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element name="note" maxOccurs="unbounded"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element name="id" type="xs:string" /> | |||
<xs:element name="url" type="xs:string" /> | |||
<xs:element name="users"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element name="user" maxOccurs="unbounded"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element name="time" type="xs:string" /> | |||
<xs:element name="name" type="xs:string" /> | |||
<xs:element name="comment" type="xs:string" /> | |||
<xs:element name="tags"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element name="tag" type="xs:string" maxOccurs="unbounded" /> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:schema> | |||
</source> | |||
== XSLT fail == | |||
<source lang="xml"> | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |||
<xsl:template match="/"> | |||
<html> | |||
<body> | |||
<h1>Notes</h1> | |||
<ul> | |||
<xsl:for-each select="notes/note"> | |||
<li> | |||
<h2><xsl:value-of select="url"/></h2> | |||
<ul> | |||
<xsl:for-each select="users/user"> | |||
<li><b><xsl:value-of select="name"/>: </b><xsl:value-of select="comment"/></li> | |||
</xsl:for-each> | |||
</ul> | |||
<h3>Tags</h3> | |||
<ul> | |||
<xsl:for-each select="users/user/tags/tag"> | |||
<xsl:sort select="."/> | |||
<li><xsl:value-of select="."/></li> | |||
</xsl:for-each> | |||
</ul> | |||
</li> | |||
</xsl:for-each> | |||
</ul> | |||
</body> | |||
</html> | |||
</xsl:template> | |||
</xsl:stylesheet> | |||
</source> |
Revision as of 16:04, 3 April 2012
Meeskond
- Liikmed: Jevgeni Nesterenko, Jako Heinmets, Lauri Rooden
Idee
Märkmete jagamise teenus. Leides internetist huvitava veebilehe, saab kasutaja bookmarkletil klikates seda koos kommentaariga sõpradele jagada. Kasutajad saavad neile jagatud märkmeid sirvida sarnaselt uudistevoole.
XML fail
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="kolmas.xslt"?>
<notes>
<note>
<id>dcf0e99</id>
<url>https://wiki.itcollege.ee/</url>
<users>
<user>
<time>2012-04-03T15:40</time>
<name>Lauri Rooden</name>
<comment><![CDATA[Kooli wiki]]></comment>
<tags>
<tag>kool</tag>
</tags>
</user>
<user>
<time>2012-04-03T15:41</time>
<name>Jako Heinmets</name>
<comment><![CDATA[ITK wiki]]></comment>
<tags>
<tag>ITK</tag>
<tag>wiki</tag>
</tags>
</user>
</users>
</note>
<note>
<id>25de837</id>
<url>https://wiki.itcollege.ee/index.php/Meeskond_"Kolmas"</url>
<users>
<user>
<time>2012-04-03T15:41</time>
<name>Lauri Rooden</name>
<comment><![CDATA[Kodutoo wikileht]]></comment>
<tags>
<tag>kool</tag>
</tags>
</user>
</users>
</note>
</notes>
XSD fail
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="notes">
<xs:complexType>
<xs:sequence>
<xs:element name="note" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="id" type="xs:string" />
<xs:element name="url" type="xs:string" />
<xs:element name="users">
<xs:complexType>
<xs:sequence>
<xs:element name="user" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="time" type="xs:string" />
<xs:element name="name" type="xs:string" />
<xs:element name="comment" type="xs:string" />
<xs:element name="tags">
<xs:complexType>
<xs:sequence>
<xs:element name="tag" type="xs:string" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XSLT fail
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h1>Notes</h1>
<ul>
<xsl:for-each select="notes/note">
<li>
<h2><xsl:value-of select="url"/></h2>
<ul>
<xsl:for-each select="users/user">
<li><b><xsl:value-of select="name"/>: </b><xsl:value-of select="comment"/></li>
</xsl:for-each>
</ul>
<h3>Tags</h3>
<ul>
<xsl:for-each select="users/user/tags/tag">
<xsl:sort select="."/>
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>