Different ways to represent a system of names & marks
A very simple illustration of XML techniques. Very useful as a base for
coding examples.
The idea is to give an XML structure to a list of (students) names and
marks (in the French way : an integer between 0 and 20).
In order to stress the importance of character encoding, names will be
written with a wide range of scripts.
- Text form 1 : raw text
- Text form 2 : CSV (spreadsheet)
- XML model 0
- XML model 1
- XML model 2
- XML-RDF form
-
One name and mark per line, separated by one or more blanks - or tabs.
Example file : NN.txt
অগ্নিভ 13
André 09
अश्विन् 17
ధర్మవర్ధన్ 14
Đức 17
Hélène 17
François 07
Frédéric 13
Joëlle 06
João
Jürgen 12
Κωσταντίνος 15
नीरज 14
सैली 15
-
Example file :
NN.csv
Name,Mark
অগ্নিভ,13
André,9
अश्विन्,17
ధర్మవర్ధన్ ,14
Đức,17
Hélène,17
François,7
Frédéric,13
Joëlle,6
João,5
Jürgen,12
Κωσταντίνος ,15
नीरज,14
सैली,15
-
names as tags, marks as their content
Example file : NN.0.xml
<?xml version="1.0" ?>
<list>
<অগ্নিভ>13</অগ্নিভ>
<André>09</André>
<अश्विन्>17</अश्विन्>
<ధర్మవర్ధన్>14</ధర్మవర్ధన్>
<Đức>17</Đức>
<Hélène>17</Hélène>
<François>07</François>
<Frédéric>13</Frédéric>
<Joëlle>06</Joëlle>
<João>05</João>
<Jürgen>12</Jürgen>
<Κωσταντίνος>15</Κωσταντίνος>
<नीरज>14</नीरज>
<सैली>15</सैली>
</list>
-
names and marks as attributes of
<student>
- remember that attribute ordering is irrelevant !
Example file : NN.1.xml
<?xml version="1.0" ?>
<list>
<student mark="13" name="অগ্নিভ"/>
<student mark="09" name="André"/>
<student mark="17" name="अश्विन्"/>
<student mark="14" name="ధర్మవర్ధన్"/>
<student mark="17" name="Đức"/>
<student mark="17" name="Hélène"/>
<student mark="07" name="François"/>
<student mark="13" name="Frédéric"/>
<student mark="06" name="Joëlle"/>
<student mark="05" name="João"/>
<student mark="12" name="Jürgen"/>
<student mark="15" name="Κωσταντίνος"/>
<student mark="14" name="नीरज"/>
<student mark="15" name="सैली"/>
</list>
-
names and marks as children of
<student>
Example file : NN.2.xml
<?xml version="1.0" ?>
<liste>
<student>
<name>অগ্নিভ</name>
<mark>13</mark>
</student>
<student>
<name>André</name>
<mark>09</mark>
</student>
<student>
<name>अश्विन्</name>
<mark>17</mark>
</student>
<student>
<name>ధర్మవర్ధన్</name>
<mark>14</mark>
</student>
<student>
<name>Đức</name>
<mark>17</mark>
</student>
<student>
<name>Hélène</name>
<mark>17</mark>
</student>
<student>
<name>François</name>
<mark>07</mark>
</student>
<student>
<name>Frédéric</name>
<mark>13</mark>
</student>
<student>
<name>Joëlle</name>
<mark>06</mark>
</student>
<student>
<name>João</name>
<mark>05</mark>
</student>
<student>
<name>Jürgen</name>
<mark>12</mark>
</student>
<student>
<name>Κωσταντίνος</name>
<mark>15</mark>
</student>
<student>
<name>नीरज</name>
<mark>14</mark>
</student>
<student>
<name>सैली</name>
<mark>15</mark>
</student>
</liste>
-
For the background behind this representation see here.
Example file : NN.rdf.xml
<?xml version="1.0" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:epita="http://epita/masters/international/"
xml:base="http://epita/masters/international/perso">
<rdf:Description rdf:about="#অগ্নিভ">
<epita:mark>13</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#André">
<epita:mark>09</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#अश्विन्">
<epita:mark>17</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#ధర్మవర్ధన్">
<epita:mark>14</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#Đức">
<epita:mark>17</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#Hélène">
<epita:mark>17</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#François">
<epita:mark>07</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#Frédéric">
<epita:mark>13</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#Joëlle">
<epita:mark>06</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#João">
<epita:mark>05</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#Jürgen">
<epita:mark>12</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#Κωσταντίνος">
<epita:mark>15</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#नीरज">
<epita:mark>14</epita:mark>
</rdf:Description>
<rdf:Description rdf:about="#सैली">
<epita:mark>15</epita:mark>
</rdf:Description>
</rdf:RDF>