CIT 597 Quiz 4: DTDs and DOM
Fall 2008, David Matuszek Name_________________________________________
  1. (20 points) Write a DTD fragment to describe the following XML.
        <link>
            <linkText>Dr. Dave's Home page</linkText>
            <url>www.cis.upenn.edu/~matuszek</url>
        </link>







  2. (20 points) Write an example of the XML that is described by the following DTD fragment.

    <!ATTLIST dog name CDATA #REQUIRED age CDATA #IMPLIED>




  3. (30 points) List the three most important (according to Dave) subclasses of NODE, and for each one, tell what getNodeValue() returns.

    1. Applied to a NODE of type ___________, getNodeValue() returns _______________.

    2. Applied to a NODE of type ___________, getNodeValue() returns _______________.

    3. Applied to a NODE of type ___________, getNodeValue() returns _______________.

  4. (10 points) The single most important difference between SAX and DOM is what happens to the XML as it is read in. What does DOM do?




  5. (10 points) NamedNodeMap is not a subinterface of Map. Give a possible explanation for why this is so.




  6. (10 points) What does it mean to say that an XML file is valid?