Class Notes (4): What is XML?

with 1 Comment

These are the class notes for the “Introduction to XML and editing ancient documents” seminar I am doing this summer semester at LMU, Munich.

In this class I will introduce XML and explain how it is created. We will look at the tags and attributes and the participants will have a chance to try their hands at writing some XML. The important lesson to learn from this class is that XML tags are defined by the user. Therefore, the participants will be given a citation from Jane Austen’s Persuasion to markup with tags that make sense to them. 

So today we pretty much did that. We began by looking at the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<document>
    <sentence>My name is 
        <name type="person">
            <firstName>Henriette</firstName> 
            <lastName>Roued</lastName>
        </name> 
    </sentence>
</document>

I described how the tags are completely made up by myself and as an exercise the participants were given an XML document with no tags.

<?xml version="1.0" encoding="UTF-8"?>
“I do not think I ever opened a book in my life
which had not something to say upon woman's inconstancy. 
Songs and proverbs, all talk of woman's fickleness. 
But perhaps you will say, these were all written by men."

"Perhaps I shall. Yes, yes, if you please, no reference to examples in books. 
Men have had every advantage of us in telling their own story. 
Education has been theirs in so much higher a degree;
the pen has been in their hands. 
I will not allow books to prove anything.” 

Jane Austen, Persuasion

I asked the participants to markup the text with the tags and attributes they felt were meaningful. Here are some of the suggestions from the class below.

<?xml version="1.0" encoding="UTF-8"?>
<myfavouritebook xml:lang="english">
<quote source="book" xml:id="1">“I do not think I ever opened a book in my life
which had not something to say upon woman's inconstancy. 
Songs and proverbs, all talk of woman's <word type="funny">fickleness</word>. 
But perhaps you will say, these were all written by men."</quote>

<quote source="book" xml:id="2"><quotationMark type="in">"</quotationMark>Perhaps I shall. Yes, yes, if you please, no reference to examples in books. 
Men have had every advantage of us in telling their own story. 
Education has been theirs in so much higher a degree;
the pen has been in their hands. 
I will not allow books to prove anything.<quotationMark type="out">”</quotationMark> </quote>

<author>Jane Austen</author>, Persuasion</myfavouritebook>

The participants got the idea of XML and learnt how they can create it themselves to store text-based data. We also discussed the issues of marking up the text with all our own tags and how this will create a problem if we want to share the XML documents. But more on that next week …

Here are some link that you might want to check out before next week:

One Response

  1. […] should be both wellformed and valid. Last week we used our XML editors to write wellformed XML. We encoded words […]