CMSI 655
Quiz 1

The test is open-everything with the sole limitation that you neither solicit nor give help while the exam is in progress.

  1. Give an example of an XML document that validates according to this DTD:

    <!ELEMENT catalog (product+)>
    
    <!ELEMENT product (specifications+,options?,price+,notes?)>
    <!ATTLIST product
        name CDATA #IMPLIED
        category (handtool|table|shop-professional) "handtool"
        partnum CDATA #IMPLIED
        plant (pittsburgh|milwaukee|chicago) "chicago"
        inventory (instock|backordered|discontinued) "instock">
    
    <!ELEMENT specifications (#PCDATA)>
    <!ATTLIST specifications
        weight CDATA #IMPLIED
        power CDATA #IMPLIED>
    
    <!ELEMENT options (#PCDATA)>
        <!ATTLIST options
        finish (metal|polished|matte) "matte"
        adapter (included|optional|notapplicable) "included"
        case (hardshell|soft|notapplicable) "hardshell">
    
    <!ELEMENT price (#PCDATA)>
    <!ATTLIST price
        msrp CDATA #IMPLIED
        wholesale CDATA #IMPLIED
        street CDATA #IMPLIED
        shipping CDATA #IMPLIED>
    
    <!ELEMENT notes (#PCDATA)>
    
  2. Give a stylesheet to allows you to make green "buttons" that have thick blue borders and yellow text. When you hover over the button, the button should turn pink. Remember to have a little bit of padding, and be sure not to end up with underlined text. Ensure that the text is centered within the button.
  3. Explain the difference between
    a img {
      border-style: none;
      color: white;
    }
    

    and

    a,img {
      border-style: none;
      color: white;
    }
    
  4. The following HTML start tag uses too many deprecated attributes. Show how to make it conform to the XHTML Strict DTD:
    <body text=red link=green alink=blue vlink=gold
              bgcolor=orange background="triangles.gif">
    
  5. What is wrong with a designer specifying text on a page to be 14pt?
  6. Here is an old HTML page. It's laid out with tables and doesn't use style sheets nor does it quote attributes and show all closing tags. Clean it up. Yes, that means completely remove the table element. Do not use inline styles.
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr><td colspan=2 height=200 align=center>ONE</tr>
    <tr><td width=50 height=100><u>TWO</u><td><font face=Arial>THREE</font>
    <tr><td bgcolor=yellow width=300>FOUR<td>FIVE
    </table>
    
  7. A designer for a startup company (call it XOZO just for concreteness) forwhose survival depended on people finding the company's website thought that if the company's name appeared in a Art Deco style, with letters nicely spaced out, people would come to the site. Understanding, at least, that search engine spiders don't read the text in graphics, but do pay attention to the content of <h1> tags, and furthermore being enlightend enough not to use <font> tags, the designer wrote:
       <h1 style="font-size:400%">X&nbsp;O&nbsp;Z&nbsp;O</h1>
    

    Describe how to fix this using an image replacement technique, but also show a simpler way.