Programming XML in Java - Homework 1
Instructor: John Punin
CSCI 2965 Fall 2001
Due: September 19th 11:59:59 PM
Objective
The objective of this homework is to help you become familiar with the
concepts of well-formed XML Document, valid XML Document, DTD and XML Schema
Part A
Write an example of a well-formed XML Document that stores laptop specifications
and the identification of its owner. For example, the IBM
Thinkpad T22 specifications are:
-
Hardware
900 MHz Mobile Pentium III with Intel SpeedStep technology
256MB RAM (expandable)
32 GB internal hard drive
14.1" 1400x1050 SXGA+ TFT active matrix display (8MB SGRAM)
3.5" 1.44MB floppy drive
10/100 Ethernet/56K V.90 modem combo mini PCI card
DVD CD-ROM drive
PC card slot
Full complement of ports including: USB, serial, parallel
Multimedia-capable
Lithium-ion battery
Three-year warranty
Weighs less than 5 pounds
-
Pre-Installed Software
Microsoft Windows 98 Second Edition
Microsoft Office XP Pro
Microsoft Visual C++
Microsoft Visual Basic
Waterloo Maple 7(symbolic algebra program)
SolidWorks 2001 (a CAD package)
MapInfo Pro 6
National Instruments LabView 6i
SecureCRT
Internet Explorer/Netscape Communicator
Norton Anti-virus software
and more
-
Also included:
Security cable with lock
Kelty backpack laptop carrying case
Ethernet cable
An example of its owner specification is:
-
Name: John Smith
-
RIN: 987654321
-
Email: smithj@rpi.edu
-
Class: JR
-
Major: CSCI
Feel free to add more information related to the laptop or owner. The XML
document should list more than three different types of laptop specifications
and more than ten different owners.
Part B
Write a DTD that describes the structure and semantics of your answer to
part A. Use ENTITY, ELEMENT, and ATTLIST declarations
in your DTD. Please write comments in your DTD, explaining each declaration
of your DTD.
Associate your DTD with the well-formed XML Document of part A to make
a valid XML Document. Report this valid XML document and validate it using
the Scholarly Technology Group at Brown University's validator at: http://www.stg.brown.edu/service/xmlvalid/
. Include in your report the validator's results.
Part C
Write a W3C XML Schema that describes the structure and semantics of your
answer to part A. Use simpleType, complexType, element,
attribute
and group elements to write your XML Schema. Please write comments
for each simpleType, complexType, element,
attribute
and group elements of your XML Schema.
Associate your XML Schema with the well-formed XML Document of part
A to make a valid XML Document. Report this valid XML document.
Optional: Try to validate your XML Schema Document and your valid
XML Document using the XSV Validator at: http://www.w3.org/2001/03/webdata/xsv
. Include in your report the validator's result.
Submission procedure:
In one email message to gamars@rpi.edu, with the subject line reading "XMLJ:
HW # 1 submission". You can write a little message if you want and then
should include the files AS ATTACHMENTS. If you have 2 files, then you
should have 2 attachments in the email message. Just as long as each attachment
contains only one file.
to
Programming XML in Java Home Page