You are on page 1of 5

EMLex Master Programme

Assignment No. 11
Student: Nikola Zdravkovic Mentor: Idalete Dias

PART A:
1. What does the word “Extensible” in the designation “Extensible Markup Language”
mean?
It means that it is not consisted of a fixed set of tags and that we as users are free to make up our
own names for the elements used.
2. Why is XML considered to be a meta-markup language?
Because XML is the one language used in the process of building or defining other markup
languages, such as Chemical Markup Language (CML), Mathematical Markup Language
(MathML), MusicML and so on.
3. Define the concept “descriptive annotation/markup language” and give an example.
When using a descriptive markup system, the description of the document’s structure as well as
of the nature and function of its parts is given. Descriptive markup system distinguishes itself by
defining what a piece of text is, not what should be done with it.
Examples for such markup system can be diverse terms, for example <author>, <date>, <place>
etc.
4a. What is a well-formed XML document?
A well-formed XML document is a valid XML document and should begin with an XML
declaration, which, like all other elements of the document, should take into account that XML is
case-sensitive. It also should be formed according to the syntax rules of the language, i.e. to
fulfill both logical and physical structures.
4b. Name 5 rules to create well-formed XML documents.
- Should begin with and XML declaration
- There has to be a single root element which contains the whole XML document
- XML allows for hierarchically structured data, which means that an element can contain
other elements.
- Omission of delimiters such as angle brackets or quotation marks is not permitted
- XML tags are case-sensitive
5. What is an XML declaration?
It is an XML processing instruction because it begins with “<?” and ends with “?>” and serves to
identify the document as being XML.
PART B:
1. Below is an extract from an XML document.
<book>
<coverInfo>
<title>The XML Handbook</title>
<author>Charles F. Goldfarb</author>
<author>Paul Prescod</author>
<edition>Second</edition>
<description>The definitive XML resource: applications, products, and technologies. Revised
and expanded ~ over 600 new pages</description>
</coverInfo>
</book>

<book>
<coverInfo>
<title>PHP 5 Power Programming</title>
<author>Andi Gutmans</author>
<author>Stig Saether Bakken</author>
<author>Derick Rethans</author>
<edition>First</edition>
<description>Expert PHP 5 programming techniques, including PEAR, extensions and database
access</description>
</coverInfo>
</book>

1. What extra element would you need to add to the above document to fulfill the XML
requirements?
Besides inserting the XML declaration which should be present in every XML document, this
extract needs a single root element for the two “<books>”. The reason is that only one top
element is allowed in an XML document. The missing element can be named for example
“<list>”. There is also a possibility to change the element “<book>” into two different ones, i.e.
“<book1>” and “<book2>”.
2. Draw a hierarchical tree diagram to represent the data relationships.

PART C:
1. Check the following document instances for well-formedness.
a. <list><title>List 1</title><item>Item 1</list> (</item> should be inserted after “Item 1”)
b. <item>An Item</item><item>Another Item</item> (Only one top element is allowed in
an XML document and here we have two same “items”. Another top level element should be
inserted, for example <list> </list>)
c. <Paragraph>Bathing a cat is <emph>relatively</emph> easy provided the cat is
willing!</paragraph> (XML is case-sensitive, the closing of paragraph should be the same as the
beginning, and hence it should be written </Paragraph>)
d. <biblio><title>How to Bath a Cat<author></title>Peter Scratchmore<author></biblio>
(the postion of the “<author>” and “</title>” should be swapped in order for this document to be
well-formed)
e. <segment type="text">some text<segment/> (the “slash” in the ending of the tag
“segment” should be after the first, opening angle bracket, so the ending should look like this:
</segment>.
f. <segment type=text>some text</segment> (the attribute value after the equation sign
should be marked with quotation marks. It should look like this: <segment type=’text’>some
text</segment>
2. Correct any errors you may find.
PART D:
Create a well-formed XML document corresponding to the following entry (word ‘sample’
noun) from the online Longman Dictionary of Contemporary English:
http://www.ldoceonline.com/dictionary/sample_1

<?xml version='1.0' encoding='iso-8859-1' standalone='yes'?>


<entry>
<word><b>sample1</b></word><form><IPA>/ˈsɑːmpəl $ ˈsæm-
/</IPA></form><frequency>●●● S3 W2</frequency><number>noun
[countable]</number><pronunciation1>British</pronunciation1><pronunciation2>American</p
ronunciation2>
<sense n="1">
<def>a small part or amount of something that is examined in order to find out something about
the whole<b>sample of</b></def>
<example1>I’d like to see some samples of your work.</example1>
<example2>They took a <b>blood sample</b> to test for hepatitis.</example2>
</sense>
<sense n="2">
<def>a small amount of a product that people can try in order to find out what it is
like<b>sample of</b></def>
<example>free samples of a new shampoo</example>
</sense>
<sense n="3">
<def>a small group of people who have been chosen from a larger group to give information or
answers to questions</def>
<example1>The sample consisted of 98 secondary school teachers.</example1>
<example2>Out of a <b>random sample</b> of drivers, 21% had been in an accident in the
previous year.</example2>
<example3>a nationally <b>representative sample</b> of over 950 elderly persons</example3>
</sense>
<sense n="4">
<def>a small part of a song from a CD or record that is used in a new song</def>
<example>Her latest album makes extensive use of samples from a wide range of acid jazz
tracks.</example>
</sense>
</entry>

You might also like