=========================preview======================
(ELEC360)E360-03F-Q02 Solution.pdf
Back to ELEC360 Login to download
======================================================

Hong Kong University of Science and Technology
Department of Electrical & Electronic Engineering

ELEC 360 C Digital Media and Multimedia Applications By Dr. Sam Chiu
Fall 2003 Quiz #2
Solution
Name:
ID:
Email:
Answer all questions. Time allowed: 45 minutes
1. XML
The Hong Kong Observatory (HKO) has recently launched a new service1 whereby companies and organizations can retrieve weather bulletins automatically through their own computer systems. The weather bulletins are disseminated by HKO in XML format. In the service description, it says:
XML is a new generation of computer language format specially designed for data exchange between computer systems. It facilitates users to develop programs to ingest weather information into their application systems in accordance with their own needs. The weather elements can then be freely distributed and used within their companies or organizations.
(a) Which of the following is NOT a reason of using the XML format? [1 mark]
C. The strict data type definitions allow effective data checking and validation.
B. The XML format is easily understood by general users.
A. The formats are standardized so programmers spend less time on understanding them.
D. Software packages are widely available that are capable of reading standard XML documents.
References:
Press release - www.hko.gov.hk/wxinfo/news/2003/pre1031e.htm
Demo and descriptions - demo.xml.weather.gov.hk/

(b) If you are an application programmer at an organization that subscribes to XML weather
information from HKO, you are NOT required to do which of the following? [1 mark]
A. Obtain an XML Schema that defines the data format in order to validate the XML weather bulletins.
B. Design a style sheet (in XSL) that defines the look and feel of the weather bulletin to be displayed on the local system.

Define a Document Type Definition (DTD) document in order to specify the data format and data types to be used in the weather bulletins.
D. Establish and maintain on-line access to HKOs XML weather bulletin site.
Refer to ANNEX A, which shows a sample of the weather bulletin from HKO, in XML format.
(c) From the sample, it can be seen that the HKO has created its own Markup Language (ML) for weather information. What is the abbreviated name of this ML? [1 mark]
WXNML
(d) At the specified <BulletinTime>, what was the air temperature at Kings Park? [1 mark]
32 degrees Celsius NB. No marks if unit is missing.
(e) The <GeneralWeather> element contains two immediate sub-elements. [2 marks] What are they?
<Weather>, <UltraViolet>
(f) The <RegionalWeather> section is designed to express weather information from multiple locations. The following code fragment contains an error. What is wrong? Explain your answer. [2 marks]
<RegionalWeather>

<Regions>
<Name>SHA TIN</Name>
<Temperature><InDegreeCelsius value=32 /></Temperature>
</Regions>


</RegionalWeather>
The