Wednesday, November 17, 2010

Week7

First part of lesson was about thesis writing - some really useful suggestions and guidelines. Discussed basic formatting/structure, standards and other rules and academic ways + some handy tips, DOs and DONTs.

Then we discussed CSS and how this is used to style HTML and even XML documents. CSS provides properties for text style, fonts, color/background, border and display. We also briefly dicussed AJAX and its use.


CMT3315  –  Lab Session 07
Quick questions:
1.    People who prepare XML documents sometimes put part of the document in a CDATA section.
    1. Why would they do that?
So that it is  ignored and NOT parsed

    1. How is the CDATA section indicated?
<![CDATA[ anything can be placed here ]]>

    1. If CDATA sections hadn’t been invented, would there be any other way to achieve the same effect?
Use the &lt; &gt; &apos; &quot; &amp for special characters in a normal PCDATA tag

2. What is a parser and what does it have to do with validity?
A parser is a computer program that extracts (parses) and displays the content within the tags of an xml file. It does so while validating the content by comparing the structure and types to a DTD documant.

3. You write a .dtd file to accompany a class of XML documents. You want one of the elements, with the tag <trinity>, to appear exactly three times within the document element of every document in this class. Is it possible for the .dtd file to specify this?
No

Longer questions:
1.        The following is one of the documents that featured in last week’s exercises. As mentioned before, this is to be “Chapter 2: Volcanic winter” in a book.
a)      Write a suitable prolog for this document.
<?xml version="1.0" encoding="UTF-16"?>
 <!DOCTYPE Chapter2
[

b)      Write a .dtd file to act as the Document Type Description for this document. Or modify the one you wrote last week, if you wrote one.
           see ans. 2b of Lab Session 06

c)      Put tags into the document. Obviously, there must be a document element. But also, the poem needs special treatment (because of the way it will be displayed) and, in fact, each line of the poem needs special treatment (you can spot the places where the lines start, by the capital letters). The mention of the poets at Geneva needs to be identified, because it will feature in the index, and so do the pyroclastic flows and Mount Tambora and Sumbawa and the year without a summer and the famines.


2. This chapter obviously needs some pictures. You have available the following, and you decide to include them in the chapter, at appropriate places:
-       a picture of Sumbawa, after the volcanic eruption. It’s in a file sumbawa.jpg. Caption: “Sumbawa, after the volcanic eruption”.
-       a picture of Lake Geneva, in 1816. It’s in a file Geneva1816.jpg. Caption: “Lake Geneva, during the summer of 1816”.
-       a picture of Mary Shelley. It’s in a file MaryShelley.jpg. Caption: “Mary Shelley, author of Frankenstein”.
Amend your two files so that they can cope with these pictures and captions.

No comments:

Post a Comment