![]() |
1. (50 points).
The famous 1972 IBM "8-bar" logo is shown to the left. The IBM logo text letters are shown using the font named "Men in Blue" from the foundry: http://www.digitalempires.com. Also shown is a three byte logo (i.e., "WWW") created to simulate an "IBM-logo-like" font. The lower logo is created by the javascript function named p1 when the button labelled "Execute p1" is clicked. This sub:
|
<XML id="tex_gov_list"> <?xml version="1.0"?> <!DOCTYPE tex_govs [ <!ELEMENT tex_govs (gov+)> <!ELEMENT gov (govnum, govname, term_start, term_end, party, lt_gov+)> <!ELEMENT govnum (#PCDATA)> <!ELEMENT govname (#PCDATA)> <!ELEMENT term_start (#PCDATA)> <!ELEMENT term_end (#PCDATA)> <!ELEMENT party (#PCDATA)> <!ELEMENT lt_gov (#PCDATA)> ]> <tex_govs><gov><govnum>1</govnum><govname>James Pinckney Hterm_enderson</govname> <term_start>February 19, 1846</term_start><term_end>December 21, 1847</term_end><party>Democratic</party> <lt_gov>Albert Clinton Horton</lt_gov></gov> <gov><govnum>2</govnum><govname>George T. Wood</govname> <term_start>December 21, 1847</term_start><term_end>December 21, 1849</term_end><party>Democratic</party> <lt_gov>John Alexander Greer</lt_gov></gov> <gov><govnum>3</govnum><govname>Peter Hansborough Bell</govname> <term_start>December 21, 1849</term_start><term_end>November 23, 1853</term_end><party>Democratic</party> <lt_gov>John Alexander Greer (1849-51)</lt_gov><lt_gov> James W. Hterm_enderson (1851-53)</lt_gov></gov><xml id="census_2009"> ...lotsa lines omitted... <gov><govnum>45</govnum><govname>Ann Richards</govname> <term_start>January 15, 1991</term_start><term_end>January 17, 1995</term_end><party>Democratic Bob Bullock</party><lt_gov>William P. Hobby, Jr.</lt_gov></gov> <gov><govnum>46</govnum><govname>George W. Bush</govname> <term_start>January 17, 1995</term_start><term_end>December 21, 2000</term_end><party>Republican</party> <lt_gov>Bob Bullock (1995-99)</lt_gov><lt_gov> Rick Perry (1999-2000)</lt_gov></gov> <gov><govnum>47</govnum><govname>Rick Perry</govname> <term_start>December 21, 2000</term_start><term_end>Incumbent</term_end><party>Republican</party> <lt_gov>Bill Ratliff (acting) (2000-03)</lt_gov><lt_gov>David Dewhurst (2003-present)</lt_gov></gov> </tex_govs></XML> |
2. (50 points) The XML shown to the left contains data about the 47 govenors of Texas. The XML is in an IE XML container with id="tex_gov_list". Write a javascript function named p2, that is executed by clicking this button:
This function processes the XML to produces a: a 47 row, 6 column table that contains in each row:
(1) the govenors sequence num (govnum) in the 1st column; (2) the govenors name (govname) in the 2nd column; (3) the beginning date (term_start) of their office in the 3rd column; (4) the term_ending date (term_end) of their office in the 4th column; (5) the political party (party) in the fifth column; (6) one or more lieutenant govenors (lt_gov) -- each on a line by itself in the 6th column Further, after the table, display the number of people with the name "Hobby" (govenor OR lt. govenor) Notes:
Show only the javascript for p2. Show NO HTML.
this is the pout3 DIV block this is the pout2 DIV block
|