6. Quiz Questions

If you would like to look up the answers for the following quiz questions, you can check our discussion forum. If you don't find an answer in the forum, you may create a post asking for an answer to a particular question.

6.1. Question 1: Well-formed XML documents

Which of the following statements represent a requirement for a well-formed XML document? Select one or more:

☐ The root element must have a namespace attribute.

☐ There must be one and only one top level element.

☐ All non-empty elements must have a start-tag and an end-tag with matching names.

☐ Element names must be lower case.

6.2. Question 2: Well-formed XML

Which of the following fragments are well-formed XML? Select one or more:

☐ <strong>This text is bold. <em>and this is italicized and bold.</EM></strong><em>and this is just italics.</em>

☐ <STRONGER>This text is bold. <emph>And this is italicized and bold.</STRONGER> And this is just italics.</emph>

☐ <stronger>This text is bold. <emph>And this is italicized and bold.</emph></stronger><emph>And this is just italics.</emph>

☐ <emph><STRONGER>This is some text <bold>and this is more text. Here is even more</bold> text.</STRONGER></emph>

6.3. Question 3: Valid XHTML

Which of the following fragments are valid XHTML? Select one or more:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head><title>My Title</title></head>
  <body><a href="http://www.examples.org"/>Jump!</a></body>
</html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head><title>My Title</title></head>
  <body><p>Lorem ipsum...</p></body>
</html>

<h:html xmlns:h="http://www.w3.org/1999/xhtml">
  <h:head><h:meta charset="utf-8"></h:head>
  <h:body><h:p>Lorem ipsum...</h:p></h:body>
</h:html>

<h:html xmlns:h="http://www.w3.org/1999/xhtml">
  <h:head><h:title>My Title</h:title></h:head>
  <h:body><h:div>Lorem ipsum...</h:div></h:body>
</h:html>

<h:html xmlns:h="http://www.w3.org/1999/xhtml">
  <head><title>My Title</title></head>
  <body><p>Lorem ipsum...</p></body>
</h:html>

6.4. Question 4: Valid XHTML5

Which of the following are correct statements about an XHTML5 document? Select one or more:

☐ The root element must be <xhtml>.

☐ The document must be well-formed.

☐ The root element and all its descendant elements must be in the namespace "http://www.w3.org/1999/xhtml".

☐ Case does not matter for element names, so both H1 and h1 can be used.

6.5. Question 5: HTML forms

Recall that an HTML form is a section of a document consisting of block elements that contain controls and labels on those controls. Which of the following form elements represent correct forms? Select one or more:

  1. <form>
      <div><label>ISBN: <input name="isbn" /></label></div>
      <div><label>Title: <input name="title" /></label></div>
    </form>
  2. <form>
      <div>
        <label for="isbn">ISBN: </label><input id="isbn" name="isbn" />
        <label for="title">title: </label><input id="title" name="title" />
      </div>
    </form>
  3. <form>
      <div><label>ISBN: </label><input name="isbn" /></div>
      <div><label>title: </label><input name="title" /></div>
    </form>
  4. <form>
      <label>ISBN: <input name="isbn" /></label><br/>
      <label>Title: <input name="title" /></label>
    </form>
  5. <form>
      <div><label for="isbn">ISBN: </label><input name="isbn" /></div>
      <div><label for="title">title: </label><input name="title" /></div>
    </form>