em
a">
Page
10
of
18

UID
_______
_
Page
11
of
18

illD
____________
__
(2)
(6%)
You
are
given the following tvschedule.dtd. Create
an
XML file "tvschedule.xml"
that
can
pass
the validation
of
the
DTD
Schema
tvschedule.dtd.
<!ELEMENT TvSchedule (Channel+)>
<!ELEMENT Channel (Banner,Day+)>
<!ELEMENT Banner (#PCDATA)>
tvschedule.dtd
<!ELEMENT Day (Date,(HolidayJ ProgramSlot+)+)>
<!ELEMENT
Holiday
(#PCDATA)>
<!ELEMENT Date (#PCDATA)>
<!ELEMENT ProgramSiot (Time,Title,Description?)>
<!ELEMENT
Time
(#PCDATA)>
<!ELEMENT
Title
(#PCDATA)>
<!ELEMENT Description (#PCDATA)>
<!AITLIST TvSchedule
name
CD
ATA #REQUIRED>
<!AITLIST Channel
eh
an CDATA #REQUIRED>
<!ATTLIST ProgramSiot
vtr
CDATA #IMPLIED>
<!AITLIST
Title
rating
CD
ATA #IMPLIED>
<!AITLISTTitle
language CDATA #FIXED "EN">
tvschedule.xml
<?xml
version="l.O"
encoding="UTF-8"?>
<!DOCTYPE
SYSTEM
"tvschedule.dtd">
Page
12
ofl8

UID
______
_
Question 5 (30%): Suppose you are to create a voting web page vote.html as follows: Fig. Kenneth Chan Jirruny Cook Steven Wong AmyWatson . C.?st.mY .. V.Q_n~:·: The unfinished HTML code is as follows. The HTML code for creating the radio buttons provided, where the "name" attributes of all four radio buttons have the same value: in way, only one radio button can be checked at any time (if you check another, the previous check will be cancelled). <html> <head> <script> vote.html I I to be completed in subquestion </script> </head> <body> <div id=" display"> </div> <input type=" radio" name="radio_button" value="Kenneth Chan"> Kenneth Chan <br> <input type=" radio" name="radio_button" value="Jimmy Cook"> Jimmy Cook <br> <input type=" radio" name="radio_button" value="Steven Wong"> Steven Wong <br> <input type="radio" name="radio_button" value=" Amy Watson"> Amy Watson <br> <button >Cast my vote</button> </body> </html> Suppose after you check a radio button and then click the "Cast my vote" button, a sentence will be displayed in the <div id="display"></div> division: if you have not cast your vote using this browser within the past hour (the case in subquestion (3)) or within the current session (the case in subquestion (4)), the sentence to display is "You have successfully cast
1
is
this
(2)
Page
13
of
18

UID
_______
_
your vote for xxx",
where
xxx
should be replaced by
the
value
of
the
radio
button
that
you
checked;
otherwise,
the
sentence
to
display
is
"You
have previously cast your vote for
xxx",
where
xxx
should
be
replaced by
the
value
of
the
radio
button
that
you checked
when
you
voted for
the
first
time
within
the
past
hour
(the
case
in
subquestion
(3))
or within
the
current
browser
session (the
case
in
subquestion
(4)).
The
web
page will
show
up
like
Fig.
2
and
Fig.
3,
respectively. Note
that
this
operation
will
not
cause
the
page
to
reload.

Want to read all 18 pages?

Want to read all 18 pages?
You've reached the end of your free preview.
Want to read all 18 pages?
- Fall '13
- Dr. C. Wu
- Computer Science, Web page, World Wide Web, Domain Name System, Steven Wong