Rootkit: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Jkaap (talk | contribs)
Jkaap (talk | contribs)
Line 166: Line 166:
</pre>
</pre>


===XSL fail===
===XSLT fail===
<pre>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>

Revision as of 22:11, 9 June 2015

Meeskonna liikmed

  • Jaanus Kääp

XML failid

XML andmefail

<?xml version="1.0" encoding="utf-8" ?>
<workout>
	<workoutInfo>
		<date>2015-05-22</date>
		<location>sparta</location>
		<info><![CDATA[Väga väsinud olemine oli, otsustasin teha ainult 2 harjutust]]></info>
	</workoutInfo>
	<exercises>
		<exercise>
			<exerciseInfo>
				<name exerciseId="1">squat</name>
				<info><![CDATA[Ilma vööta]]></info>
			</exerciseInfo>
			<sets>
				<set nr="1">
					<weight unit="kg">110</weight>
					<goal>5</goal>
					<reps>5</reps>
					<rpe>8</rpe>
					<info/>
				</set>
				<set nr="2">
					<weight unit="kg">110</weight>
					<goal>5</goal>
					<reps>5</reps>
					<rpe>9</rpe>
					<info/>
				</set>
				<set nr="3">
					<weight unit="kg">110</weight>
					<goal>5</goal>
					<reps>4</reps>
					<rpe>9.5</rpe>
					<info><![CDATA[Viimane oli väga aeglane]]></info>
				</set>
			</sets>
		</exercise>		
		<exercise>
			<exerciseInfo>
				<name exerciseId="2">bench press</name>
				<info><![CDATA[Pausiga]]></info>
			</exerciseInfo>
			<sets>
				<set nr="1">
					<weight unit="kg">90</weight>
					<goal>3</goal>
					<reps>3</reps>
					<rpe>8</rpe>
					<info/>
				</set>
				<set nr="2">
					<weight unit="kg">90</weight>
					<goal>3</goal>
					<reps>3</reps>
					<rpe>8</rpe>
					<info/>
				</set>
				<set nr="3">
					<weight unit="kg">90</weight>
					<goal>3</goal>
					<reps>3</reps>
					<rpe>9</rpe>
					<info/>
				</set>
				<set nr="4">
					<weight unit="kg">90</weight>
					<goal>3</goal>
					<reps>3</reps>
					<rpe>9</rpe>
					<info/>
				</set>
				<set nr="5">
					<weight unit="kg">90</weight>
					<goal>3</goal>
					<reps>2</reps>
					<rpe>9.5</rpe>
					<info><![CDATA[Ei riksinud viimast enam üritada]]></info>
				</set>
			</sets>
		</exercise>
	</exercises>
</workout>

XSD fail

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="workout">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="workoutInfo">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:date" name="date"/>
              <xs:element type="xs:string" name="location"/>
              <xs:element type="xs:string" name="info"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="exercises">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="exercise" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="exerciseInfo">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="name">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute type="xs:unsignedInt" name="exerciseId" use="required"/>
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element type="xs:string" name="info"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="sets">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="set" maxOccurs="unbounded" minOccurs="0">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="weight">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:unsignedInt">
                                        <xs:attribute type="xs:string" name="unit" use="optional"/>
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element type="xs:unsignedInt" name="goal"/>
                                <xs:element type="xs:unsignedInt" name="reps"/>
                                <xs:element type="xs:float" name="rpe"/>
                                <xs:element type="xs:string" name="info"/>
                              </xs:sequence>
                              <xs:attribute type="xs:unsignedInt" name="nr" use="optional"/>
                            </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" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
	<xsl:output method="html" indent="yes"/>
	<xsl:template match="/">
		<html>
			<head>
				<Title>Tehtud harjutused</Title>
			</head>
			<body>
				<table>
					<tr>
						<td><b>Harjutuse nimi</b></td>
						<td><b>Raskus</b></td>
						<td><b>Korduste arv</b></td>
					</tr>
					<xsl:for-each select="workout/exercises/exercise">
						<xsl:variable name="exerciseName" select="exerciseInfo/name"/>
						<xsl:for-each select="sets/set">
							<tr>
								<td>
									<xsl:value-of select="$exerciseName"/>
								</td>
								<td>
									<xsl:value-of select="weight"/>
								</td>
								<td>
									<xsl:value-of select="reps"/>
								</td>
							</tr>
						</xsl:for-each>
					</xsl:for-each>
				</table>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>