<XML id="topo"> <?xml version="1.0"?> <!DOCTYPE topo [ <!ELEMENT topo (east_long,west_long,north_lat, south_lat,width,height,feature+)> <!ELEMENT east_long (#PCDATA) > <!ELEMENT west_long (#PCDATA) > <!ELEMENT north_lat (#PCDATA) > <!ELEMENT south_lat (#PCDATA) > <!ELEMENT width (#PCDATA) > <!ELEMENT height (#PCDATA) > <!ELEMENT feature (feature_long,feature_lat,feature_name)> <!ELEMENT feature_long (#PCDATA) > <!ELEMENT feature_lat (#PCDATA) > <!ELEMENT feature_name (#PCDATA) > ]> <topo> <east_long>84.1479</east_long> <west_long>84.1928</west_long> <north_lat>35.8184</north_lat> <south_lat>35.7910</south_lat> <width> 800</width> <height>600</height> <feature> <feature_long>84.1703</feature_long> <feature_lat>35.8047</feature_lat> <feature_name>Parks Ferry (historical)</feature_name> </feature> <feature> <feature_long>84.1658</feature_long> <feature_lat>35.7971</feature_lat> <feature_name>Parks homestead</feature_name> </feature> <feature> <feature_long>84.1721</feature_long> <feature_lat>35.8093</feature_lat> <feature_name>Parks Ferry Road</feature_name> </feature> </topo> </XML> |
1. (50 points) A topographical map is loaded by an HTML page and is located absolutely positioned with: Top=0px; Left=0px; and z-index=2. An XML file is also included in an XML data island with id=topo as shown to the left. This XML file provides additional information about the topographical map that is loaded on the page. Specifically:
1. The horizontal offset from the left side of the map is: width - width * ( feature longitude - east ) / ( west - east ) 2. the vertical offset from the top of the map is: height - height * ( feature latitude - south ) / ( north - south ) Here north, south, east and west refer to the four map boundaries discussed above. |
The span block contains: (1) a gif file named thex.gif; and (2) the text of the feature's name in red text (to the right of the gif). Note the span block must be positioned absolutely and have a z-index greater than 2.
Assume the following div block is available to receive the span blocks on the page:
<div id="map_over" style=" style="position:absolute;Top:0px;Left:0px;"> </div> Use root.childNodes(i).childNodes(j).text for children node values. Show no HTML. Show only the javascript for p1.
|
2.(50 points) All of George Washington's State of the Union Speeches are loaded into an array named a that contains 1,756 lines of text (and thus 1,756 array entries, beginning with index=0). A search feature for the speeches is shown to the left. It contains the ability to search for a string in the speeches by entering a string into the textbox (named sv in a form named f2) and pressing the "go" button. This button calls a javascript function named p2. The search output is to be displayed in a div block with id="d".
Each of the speeches ends with a single line of text containing the three characters "***". There are eight speeches. The search string is case sensitive (i.e., capital letters matter). The display for each line where the search string occurs is:
| |
|