{"id":89,"date":"2005-10-09T14:33:47","date_gmt":"2005-10-09T14:33:47","guid":{"rendered":"http:\/\/lachy.id.au\/log\/2005\/10\/validation-quiz-answers"},"modified":"2006-04-30T23:30:59","modified_gmt":"2006-04-30T23:30:59","slug":"validation-quiz-answers","status":"publish","type":"post","link":"https:\/\/lachy.id.au\/log\/2005\/10\/validation-quiz-answers","title":{"rendered":"Web Developer Quiz Answers"},"content":{"rendered":"<p>These are the answers to last week&#8217;s <a href=\"\/log\/2005\/10\/web-developer-quiz\">Web Developer Quiz<\/a>. If you have not attempted\r\nthe quiz yourself, I recommend you do so before reading the following answers.\r\n\tAll the responses to the quiz from ealier this week were made public earlier\r\n\ttoday. <\/p>\r\n\r\n<h3 id=\"quizans-validation\">Validation<\/h3>\r\n<p>There is only one error within the sample document, <a href=\"http:\/\/validator.w3.org\/check?uri=data%3Atext%2Fhtml%3Bcharset%3Dutf-8%2C%253C%21DOCTYPE%2520HTML%2520PUBLIC%2520%2522-%252F%252FW3C%252F%252FDTD%2520HTML%25204.01%252F%252FEN%2522%253E%250D%250A%253Chtml%2520lang%253D%2522en%2522%253E%250D%250A%2520%2520%253Ctitle%252FSample%2520HTML%25204.01%2520Document%252F%250D%250A%2520%2520%253Cp%2520align%253D%2522right%2522%253EThis%2520is%2520a%2520sample%2520HTML%25204.01%2520Strict%2520document.%250D%250A%2520%2520%253C%253EHow%2520much%2520do%2520you%2520know%2520about%2520HTML%253F%253C%252F%253E%250D%250A%2520%2520%253C%21--%2520--%2520--%253E%2520%253Cem%253EIt%25E2%2580%2599s%2520not%2520hard%21%253C%252Fem%253E%2520%253C%21--%2520--%2520--%253E%250D%250A%2520%2520%253Cp%253ECreated%2520by%2520%253Ca%2520href%253Dhttp%253A%252F%252Flachy.id.au%252F%2522%253ELachlan%2520Hunt%250D%250A%253C%252Fhtml%253E&amp;charset=%28detect+automatically%29&amp;doctype=Inline&amp;ss=1&amp;sp=1&amp;verbose=1\">validate\r\n\t\tit<\/a> and see for\r\n\tyourself:<\/p>\r\n<blockquote>\r\n\t<p><em>Line 4, column 11<\/em>: there is no attribute &#8220;ALIGN&#8221;<\/p>\r\n<\/blockquote>\r\n<p>The align attribute is not valid in HTML 4.01 Strict because it is deprecated. \r\n\tIt is valid in HTML 4.01 Transitional.  For information about why line 7 isn\u2019t\r\n\tan error, refer to the <a href=\"\/log\/2005\/05\/validation-quiz\">validation quiz<\/a> and <a href=\"\/log\/2005\/05\/validation-quiz-explanation\">associated\r\n\tanswers<\/a> I published earlier.<\/p>\r\n\r\n<h3 id=\"quizans-dom\">Elements in the DOM<\/h3>\r\n<p>There are 3 p elements within the document.  The syntax: <code>&lt;&gt;<\/code> in\r\n\tan empty start-tag, an unsupported <code>SHORTTAG<\/code> feature from SGML.  It basically\r\n\tmeans to open the most recent unclosed element.  Similarly, <code>&lt;\/&gt;<\/code> is\r\n\tan empty end-tag which ends the most recent open element. <\/p>\r\n<p>The <code>em<\/code> element will not be present because, despite appearances to the contrary,\r\n\tit is actually commented out.  The <code>head<\/code> and <code>body<\/code> elements will still be present,\r\n\teven though their start- and end-tags have been omitted.<\/p>\r\n<p>Validate it and look at the Parse Tree to confirm these answers.<\/p>\r\n\r\n<h3 id=\"quizans-semantics\">Semantics<\/h3>\r\n<p>The unordered list (option 3) is the most semantically correct.  A stylesheet\r\n\tmay be used to style it in any way desired.<\/p>\r\n<p>The <code>&lt;h1&gt;<\/code>  element without the <code>style<\/code> attribute or the <code>class<\/code> attribute\r\n\twith a presentational class name is the most appropriate markup for a document\r\n\ttitle.  An external stylesheet may be used, and is the recommended way, to horizontally\r\n\tcentre it in a visual medium using a large, bold font.  The use of the <code>style<\/code>\tattribute or the presentational class name is not recommended because it fails\r\n\tto separate the markup from the presentation.<\/p>\r\n<p>Everyone got these 2 questions correct. <strong>Well done.<\/strong>  In hindsight,\r\n\tI wish I had made these more difficult, but since semantics is not an\r\n\texact science, I found that (in general) the more complicated the question,\r\n\tthe less specific the answer could be.  So, I settled for relatively easy\r\n\tquestions for things that beginners tend to markup poorly.<\/p>\r\n\r\n<h3 id=\"quizans-charref\">Character References<\/h3>\r\n<ul>\r\n\t<li>For an HTML 4.01 document: the numeric character reference: <code>&amp;#146;<\/code> and\r\n\t\tthe character entity reference: <code>&amp;apos;<\/code> are invalid.<\/li>\r\n\t<li>For an XHTML 1.0 document: technically, none of them are invalid; however\r\n\t\tthe numeric character reference: <code>&amp;#146;<\/code>, while it is not prohibited\r\n\t\tin XML, refers to a Unicode control character and should not be used\r\n\t\tanyway.<\/li>\r\n\t<li>For a generic XML document with no DTD, only the character entity reference: <code>&amp;rsquo;<\/code> is\r\n\t\tinvalid.  <code>&amp;apos;<\/code> is valid because it is one of the 5 predefined\r\n\t\tentities in XML.<\/li>\r\n<\/ul>\r\n<p>Since few people correctly answered these questions, I will be providing more\r\n\tinformation about this in tomorrow\u2019s post.<\/p>\r\n\r\n<h3 id=\"quizans-mime\">Media Types (MIME)<\/h3>\r\n<p>An XHTML 1.1 document <strong>SHOULD NOT<\/strong> be served with the <code>text\/html<\/code>\tMIME type.  See the <a href=\"http:\/\/www.w3.org\/TR\/2002\/NOTE-xhtml-media-types-20020801\/\">XHTML\r\nMedia Types Note<\/a> for more information.<\/p>\r\n<p>An XHTML 1.0 document <strong>MAY<\/strong> be served as <code>text\/html<\/code> when\r\n\tthe document conforms to the <a href=\"http:\/\/www.w3.org\/TR\/xhtml1\/#guidelines\">Appendix\r\n\tC HTML Compatibility Guidelines<\/a> in the\r\n\tXHTML 1.0 Recommendation.  Those who pointed out that this is ludicrous get\r\n\ta bonus point.<\/p>\r\n<p>If any of you have any questions or comments regarding this quiz, please feel\r\n\tfree to let me know. The feedback I have recieved, or will recieve, regarding\r\n\tthis quiz will help me a lot with the next one I&#8217;m planning, which will most\r\n\tlikely be a CSS quiz of some kind, possibly followed by a JavaScript\/DOM\r\n\tquiz if I have time. Beyond that, well, you&#8217;ll have to wait and see. <\/p>\r\n","protected":false},"excerpt":{"rendered":"The answers to the this week&#8217;s web developer quiz.","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,1,2,7],"tags":[],"_links":{"self":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts\/89"}],"collection":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":0,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"wp:attachment":[{"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lachy.id.au\/log\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}