HMR: Difference between revisions
From ICO wiki
Jump to navigationJump to search
Line 251: | Line 251: | ||
== XML skeemifail == | == XML skeemifail == | ||
XSD is | XSD is in factory. It will produced somewhere between now and tomorrow... | ||
== XML transformatsioonifail== | == XML transformatsioonifail== |
Revision as of 22:20, 6 March 2015
Idee
Hetkel toimub idee formuleerimine
Meeskond HMR
- Harles Luts
- Mattiko Kabanen
- Ranek Runthal
XML formaadis admeedastus
XML admefail
<?xml version="1.0" encoding="utf-8" ?>
<Solarsystem>
<TableHeader>
<Column id="1" units="">
<Name lang="eng"><![CDATA[Name]]></Name>
<Name lang="est"><![CDATA[Nimi]]></Name>
</Column>
<Column id="2" units="AU">
<Name lang="eng"><![CDATA[Distance]]></Name>
<Name lang="est"><![CDATA[Kaugus]]></Name>
</Column>
<Column id="3" units="bar">
<Name lang="eng"><![CDATA[Pressure on surface]]></Name>
<Name lang="est"><![CDATA[Rõhk pinnal]]></Name>
</Column>
<Column id="4" units="">
<Name lang="eng"><![CDATA[Components of atmosphere]]></Name>
<Name lang="est"><![CDATA[Atmosfääri peamised komponendid]]></Name>
</Column>
<Column id="5" units="">
<Name lang="eng"><![CDATA[More information]]></Name>
<Name lang="est"><![CDATA[Rohem teavet]]></Name>
</Column>
</TableHeader>
<Planets count="8">
<Planet mass="0.055" unit="em" distfromsun="0.46" dunits="AU">
<Test>
<![CDATA[No see on test!!!]]>
</Test>
<Name lang="eng">
<![CDATA[Mercury]]>
</Name>
<Name lang="est">
<![CDATA[Merkuur]]>
</Name>
<Atmosphere surfpress="0.001" punit="picobar">
<Component percent="42" >
<Name lang="eng"><![CDATA[Oxygen]]></Name>
<Name lang="est"> <![CDATA[Hapnik]]></Name>
<ChemElem atoms="2">O</ChemElem>
</Component>
<Component percent="29">
<Name lang="eng">
<![CDATA[Sodium]]></Name>
<Name lang="est"><![CDATA[Naatrium]]></Name>
<ChemElem>Na</ChemElem>
</Component>
<Component percent="22">
<Name lang="eng"><![CDATA[Hydrogen]]></Name>
<Name lang="est"><![CDATA[Vesinik]]></Name>
<ChemElem atoms="2">H</ChemElem>
</Component>
</Atmosphere>
<MoreInfo type="weblink">
<![CDATA[http://nssdc.gsfc.nasa.gov/planetary/factsheet/mercuryfact.html]]>
</MoreInfo>
</Planet>
<!-- ........................................................................... -->
<Planet mass="0.815" unit="em" distfromsun="0.7" dunits="AU">
<Name lang="eng">
<![CDATA[Venus]]>
</Name>
<Name lang="est">
<![CDATA[Veenus]]>
</Name>
<Atmosphere surfpress="92" punit="bar">
<Component percent="96.5">
<Name lang="eng"><![CDATA[Carbon Dioxide]]></Name>
<Name lang="est"> <![CDATA[Süsinik dioksiid]]></Name>
<ChemElem atoms="1">C</ChemElem>
<ChemElem atoms="2">O</ChemElem>
</Component>
<Component percent="3.5">
<Name lang="est"><![CDATA[Lämmasik]]></Name>
<Name lang="eng"><![CDATA[Nitrogen]]></Name>
<ChemElem atoms="2">N</ChemElem>
</Component>
</Atmosphere>
<MoreInfo type="weblink">
<![CDATA[http://nssdc.gsfc.nasa.gov/planetary/factsheet/venusfact.html]]>
</MoreInfo>
</Planet>
<!-- ........................................................................... -->
<Planet mass="1.0" unit="em" distfromsun="1.0" dunits="AU">
<Name lang="eng">
<![CDATA[Earth]]>
</Name>
<Name lang="est">
<![CDATA[Maa]]>
</Name>
<Atmosphere surfpress="1014" punit="mbar">
<Component percent="78.08">
<Name lang="eng"><![CDATA[Nitrogen]]></Name>
<Name lang="est"> <![CDATA[Lämmastik]]></Name>
<ChemElem atoms="2">N</ChemElem>
</Component>
<Component percent="20.95">
<Name lang="est">
<![CDATA[Hapnik]]></Name>
<Name lang="eng"><![CDATA[Oxygen]]></Name>
<ChemElem atoms="2">O</ChemElem>
</Component>
</Atmosphere>
<MoreInfo type="weblink">
<![CDATA[http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html]]>
</MoreInfo>
</Planet>
<!-- ........................................................................... -->
<Planet mass="0.64174" unit="em" distfromsun="1.5" dunits="AU">
<Name lang="eng">
<![CDATA[Mars]]>
</Name>
<Name lang="est">
<![CDATA[Marss]]>
</Name>
<Atmosphere surfpress="1014" punit="mbar">
<Component percent="95.32">
<Name lang="eng"><![CDATA[Carbon Dioxide]]></Name>
<Name lang="est"> <![CDATA[Süsinik dioksiid]]></Name>
<ChemElem atoms="1">C</ChemElem>
<ChemElem atoms="2">O</ChemElem>
</Component>
<Component percent="2.7">
<Name lang="est"><![CDATA[Lämmastik]]></Name>
<Name lang="eng"><![CDATA[Nitrogen]]></Name>
<ChemElem atoms="2">N</ChemElem>
</Component>
</Atmosphere>
<MoreInfo type="weblink">
<![CDATA[http://nssdc.gsfc.nasa.gov/planetary/factsheet/marsfact.html]]>
</MoreInfo>
</Planet>
<!-- ........................................................................... -->
<Planet mass="318" unit="em" distfromsun="5.2" dunits="AU">
<Name lang="eng">
<![CDATA[Jupiter]]>
</Name>
<Name lang="est">
<![CDATA[Jupiter]]>
</Name>
<Atmosphere surfpress="1000" punit="bar">
<Component percent="89.8">
<Name lang="eng"><![CDATA[Molecular Hydorgen]]></Name>
<Name lang="est"> <![CDATA[Molekulaarne vesinik]]></Name>
<ChemElem atoms="2">H</ChemElem>
</Component>
<Component percent="10.2">
<Name lang="est"><![CDATA[Heelium]]></Name>
<Name lang="eng"><![CDATA[Helium]]></Name>
<ChemElem atoms="1">He</ChemElem>
</Component>
</Atmosphere>
<MoreInfo type="weblink">
<![CDATA[http://nssdc.gsfc.nasa.gov/planetary/factsheet/jupiterfact.html]]>
</MoreInfo>
</Planet>
<!-- ........................................................................... -->
<Planet mass="568" unit="em" distfromsun="9.5" dunits="AU">
<Name lang="eng">
<![CDATA[Saturn]]>
</Name>
<Name lang="est">
<![CDATA[Saturn]]>
</Name>
<Atmosphere surfpress="1000" punit="bar">
<Component percent="96.3">
<Name lang="eng"><![CDATA[Molecular Hydorgen]]></Name>
<Name lang="est"> <![CDATA[Molekulaarne vesinik]]></Name>
<ChemElem atoms="2">H</ChemElem>
</Component>
<Component percent="3.25">
<Name lang="est"><![CDATA[Heelium]]></Name>
<Name lang="eng"><![CDATA[Helium]]></Name>
<ChemElem atoms="1">He</ChemElem>
</Component>
</Atmosphere>
<MoreInfo type="weblink">
<![CDATA[http://nssdc.gsfc.nasa.gov/planetary/factsheet/saturnfact.html]]>
</MoreInfo>
</Planet>
<!-- ........................................................................... -->
<Planet mass="87" unit="em" distfromsun="19.2" dunits="AU">
<Name lang="eng">
<![CDATA[Uranus]]>
</Name>
<Name lang="est">
<![CDATA[Uraan]]>
</Name>
<Atmosphere surfpress="1000" punit="bar">
<Component percent="82.5">
<Name lang="eng"><![CDATA[Molecular Hydorgen]]></Name>
<Name lang="est"> <![CDATA[Molekulaarne vesinik]]></Name>
<ChemElem atoms="2">H</ChemElem>
</Component>
<Component percent="15.2">
<Name lang="est"><![CDATA[Heelium]]></Name>
<Name lang="eng"><![CDATA[Helium]]></Name>
<ChemElem atoms="1">He</ChemElem>
</Component>
</Atmosphere>
<MoreInfo type="weblink">
<![CDATA[http://nssdc.gsfc.nasa.gov/planetary/factsheet/uranusfact.html]]>
</MoreInfo>
</Planet>
<!-- ........................................................................... -->
<Planet mass="568" unit="em" distfromsun="30.1" dunits="AU">
<Name lang="eng">
<![CDATA[Neptun]]>
</Name>
<Name lang="est">
<![CDATA[Neptuun]]>
</Name>
<Atmosphere surfpress="1000" punit="bar">
<Component percent="80.0">
<Name lang="eng"><![CDATA[Molecular Hydorgen]]></Name>
<Name lang="est"> <![CDATA[Molekulaarne vesinik]]></Name>
<ChemElem atoms="2">H</ChemElem>
</Component>
<Component percent="19.0">
<Name lang="est"><![CDATA[Heelium]]></Name>
<Name lang="eng"><![CDATA[Helium]]></Name>
<ChemElem atoms="1">He</ChemElem>
</Component>
</Atmosphere>
<MoreInfo type="weblink">
<![CDATA[http://nssdc.gsfc.nasa.gov/planetary/factsheet/neptunefact.html]]>
</MoreInfo>
</Planet>
<!-- ........................................................................... -->
</Planets>
<Asteroids>
<Asteroid>
</Asteroid>
</Asteroids>
</Solarsystem>
XML skeemifail
XSD is in factory. It will produced somewhere between now and tomorrow...
XML transformatsioonifail
<?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>
<style type="text/css">
table, td, th { border: 1px solid gray }
td {align:center;}
</style>
<title>Dummy list of planets</title>
</head>
<body>
<h1>
<xsl:choose>
<xsl:when test="Solarsystem/Planets[@lang='est']">
<![CDATA[Planeetide ülevaade]]>
</xsl:when>
<xsl:otherwise>
<![CDATA[List of planets]]>
</xsl:otherwise>
</xsl:choose>
</h1>
<table>
<tr>
<xsl:for-each select="Solarsystem/TableHeader/Column">
<th>
<xsl:value-of select="Name[@lang='eng']"/>
<xsl:if test="@units!=''">
(<xsl:value-of select="@units"/>)
</xsl:if>
</th>
</xsl:for-each>
</tr>
<xsl:for-each select="Solarsystem/Planets/Planet">
<tr>
<td>
<xsl:value-of select="Name[@lang='eng']"/>
</td>
<td>
<xsl:value-of select="@distfromsun"/>
</td>
<td>
<xsl:value-of select="Atmosphere/@surfpress"/>
</td>
<td>
<ul>
<xsl:for-each select="Atmosphere/Component">
<li>
<xsl:value-of select="Name[@lang='eng']"/>
(
<xsl:for-each select="ChemElem">
<xsl:value-of select="."/>
<xsl:if test="@atoms > 1">
<sub>
<xsl:value-of select="@atoms"/>
</sub>
</xsl:if>
</xsl:for-each>
)
- [<xsl:value-of select="@percent"/>%]
</li>
</xsl:for-each>
</ul>
</td>
<td>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="MoreInfo"/>
</xsl:attribute>
<xsl:value-of select="MoreInfo"/>
</xsl:element>
</td>
</tr>
</xsl:for-each>
</table>
<!--******************************************************************-->
<h1>
<xsl:choose>
<xsl:when test="Solarsystem/Planets[@lang='est']">
<![CDATA[Siseringi planeedid]]>
</xsl:when>
<xsl:otherwise>
<![CDATA[Planets of inner circle]]>
</xsl:otherwise>
</xsl:choose>
</h1>
<table>
<tr>
<xsl:for-each select="Solarsystem/TableHeader/Column">
<th>
<xsl:value-of select="Name[@lang='eng']"/>
<xsl:if test="@units!=''">
(<xsl:value-of select="@units"/>)
</xsl:if>
</th>
</xsl:for-each>
</tr>
<xsl:for-each select="Solarsystem/Planets/Planet">
<xsl:if test="@distfromsun < 1">
<tr>
<td>
<xsl:value-of select="Name[@lang='eng']"/>
</td>
<td>
<xsl:value-of select="@distfromsun"/>
</td>
<td>
<xsl:value-of select="Atmosphere/@surfpress"/>
</td>
<td>
<ul>
<xsl:for-each select="Atmosphere/Component">
<li>
<xsl:value-of select="Name[@lang='eng']"/>
(
<xsl:for-each select="ChemElem">
<xsl:value-of select="."/>
<xsl:if test="@atoms > 1">
<sub>
<xsl:value-of select="@atoms"/>
</sub>
</xsl:if>
</xsl:for-each>
)
- [<xsl:value-of select="@percent"/>%]
</li>
</xsl:for-each>
</ul>
</td>
<td>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="MoreInfo"/>
</xsl:attribute>
<xsl:value-of select="MoreInfo"/>
</xsl:element>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Retsensioon
Veebiteenus
Klientrakendus
Logi
25.02.15 - esimene projektimeeskonna käraja