Meeskond "ASP-tastic": Difference between revisions

From ICO wiki
Jump to navigationJump to search
Jkaskmaa (talk | contribs)
No edit summary
Jkaskmaa (talk | contribs)
Line 98: Line 98:
<source lang="xml">
<source lang="xml">


This document had no style information.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:template match="/">
<html>
<html>
<body>
<body>
<h2>
<h2>
Tänane kava
Tänane kava
</h2>
</h2>
<h3>
<h3>
Kava kuupäev (Unix timestamp):  
Kava kuupäev (Unix timestamp):  
<xsl:value-of select="schedule/day/date"/>
<xsl:value-of select="schedule/day/date"/>
</h3>
</h3>
<table border="1">
<table border="1">
<tr bgcolor="#9acd32">
<tr bgcolor="#9acd32">
<th>
<th>
Jrk nr
Jrk nr
</th>
</th>
<th>
<th>
Harjutus
Harjutus
</th>
</th>
<th>
<th>
Seeriaid
Seeriaid
</th>
</th>
<th>
<th>
Korduseid
Korduseid
</th>
</th>
<th>
<th>
Aeg
Aeg
</th>
</th>
<th>
<th>
Raskus
Raskus
</th>
</th>
<th>
<th>
Kirjeldus
Kirjeldus
</th>
</th>
<th>
<th>
Kommentaar
Kommentaar
</th>
</th>
<th>
<th>
Lihasgrupid
Lihasgrupid
</th>
</th>
</tr>
</tr>
<xsl:for-each select="schedule/day/item">
<xsl:for-each select="schedule/day/item">
<tr>
<tr>
<td>
<td>
<xsl:value-of select="positionInList"/>
<xsl:value-of select="positionInList"/>
</td>
</td>
<td>
<td>
<xsl:value-of select="excercise"/>
<xsl:value-of select="excercise"/>
</td>
</td>
<td>
<td>
<xsl:value-of select="series"/>
<xsl:value-of select="series"/>
</td>
</td>
<td>
<td>
<xsl:value-of select="reps"/>
<xsl:value-of select="reps"/>
</td>
</td>
<td>
<td>
<xsl:value-of select="time"/>
<xsl:value-of select="time"/>
</td>
</td>
<td>
<td>
<xsl:value-of select="weigth"/>
<xsl:value-of select="weigth"/>
</td>
</td>
<td>
<td>
<xsl:value-of select="description"/>
<xsl:value-of select="description"/>
</td>
</td>
<td>
<td>
<xsl:value-of select="comment"/>
<xsl:value-of select="comment"/>
</td>
</td>
<td>
<td>
<ul>
<ul>
<xsl:for-each select="category/muscleGroup">
<xsl:for-each select="category/muscleGroup">
<li>
<li>
<xsl:value-of select="."/>
<xsl:value-of select="."/>
</li>
</li>
</xsl:for-each>
</xsl:for-each>
</ul>
</ul>
</td>
</td>
</tr>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</table>
</body>
</body>
</html>
</html>
</xsl:template>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>


</source>
</source>
==Logi==
==Logi==


===28.02.2011===
===28.02.2011===
XML loomine
XML loomine

Revision as of 22:55, 1 March 2011

Idee

on olemas

Meeskond

  • Indrek Kõue
  • Taivo Türnpu
  • Jarko Kaskmaa

XML

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xml" href="xml.xsl"?>

<schedule>
  <day>
    <date>1299011724</date>
    <item>
      <positionInList>1</positionInList>
      <excercise>Kükk</excercise>
      <series>3</series>
      <reps>6-8</reps>
      <time></time>
      <weigth>90</weigth>
      <description>Korralik täiskükk</description>
      <comment></comment>
      <category>
        <muscleGroup>Reied</muscleGroup>
	<muscleGroup>Sääred</muscleGroup>
	<muscleGroup>Alaselg</muscleGroup>
      </category>
    </item>
    <item>
      <positionInList>2</positionInList>
      <excercise>Jõutõmme</excercise>
      <series>4</series>
      <reps>5</reps>
      <time></time>
      <weigth>120</weigth>
      <description></description>
      <comment>See nädal on kerge jõutõmme</comment>
      <category>
        <muscleGroup>Alaselg</muscleGroup>
	<muscleGroup>Kõik jalg</muscleGroup>
	<muscleGroup>Trapetslihas</muscleGroup>
      </category>
    </item>
  </day>
</schedule>

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="schedule">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="day">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="date" type="xs:unsignedInt" />
              <xs:element maxOccurs="unbounded" name="item">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="positionInList" type="xs:unsignedByte" />
                    <xs:element name="excercise" type="xs:string" />
                    <xs:element name="series" type="xs:unsignedByte" />
                    <xs:element name="reps" type="xs:unsignedByte" />
                    <xs:element name="time" />
                    <xs:element name="weigth" type="xs:unsignedByte" />
                    <xs:element name="description" type="xs:string" />
                    <xs:element name="comment" type="xs:string" />
                    <xs:element name="category">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element maxOccurs="unbounded" name="muscleGroup" type="xs:string" />
                        </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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
	<html>
		<body>
		<h2>
		Tänane kava
		</h2>
		<h3>
		Kava kuupäev (Unix timestamp): 
		<xsl:value-of select="schedule/day/date"/>
		</h3>
		<table border="1">
			<tr bgcolor="#9acd32">
				<th>
				Jrk nr
				</th>
				<th>
				Harjutus
				</th>
				<th>
				Seeriaid
				</th>
				<th>
				Korduseid
				</th>
				<th>
				Aeg
				</th>
				<th>
				Raskus
				</th>
				<th>
				Kirjeldus
				</th>
				<th>
				Kommentaar
				</th>
				<th>
				Lihasgrupid
				</th>
			</tr>
			<xsl:for-each select="schedule/day/item">
			<tr>
				<td>
					<xsl:value-of select="positionInList"/>
				</td>
				<td>
					<xsl:value-of select="excercise"/>
				</td>
				<td>
					<xsl:value-of select="series"/>
				</td>
				<td>
					<xsl:value-of select="reps"/>
				</td>
				<td>
					<xsl:value-of select="time"/>
				</td>
				<td>
					<xsl:value-of select="weigth"/>
				</td>
				<td>
					<xsl:value-of select="description"/>
				</td>
				<td>
					<xsl:value-of select="comment"/>
				</td>
				<td>
					<ul>
					<xsl:for-each select="category/muscleGroup">
					<li>
					<xsl:value-of select="."/>
					</li>
					</xsl:for-each>
					</ul>
				</td>
			</tr>
			</xsl:for-each>
			</table>
		</body>
	</html>
</xsl:template>
</xsl:stylesheet>

Logi

28.02.2011

XML loomine