{"id":188,"date":"2003-07-01T19:25:59","date_gmt":"2003-07-01T23:25:59","guid":{"rendered":"https:\/\/www.goer.org\/wordpress\/xhtml2_explorations_part_i"},"modified":"2003-07-01T19:25:59","modified_gmt":"2003-07-01T23:25:59","slug":"xhtml2_explorations_part_i","status":"publish","type":"post","link":"https:\/\/www.goer.org\/Journal\/2003\/07\/xhtml2_explorations_part_i.html","title":{"rendered":"XHTML2 Explorations, Part I"},"content":{"rendered":"<p>You read that right: &#8220;<acronym title=\"eXtensible HyperText Markup Language: The Revenge\">XHTML2<\/acronym> Explorations&#8221;. Yes, the fun never stops here at goer.org.<\/p>\n<p>I&#8217;ve decided to take a closer look at <a href=\"http:\/\/www.w3.org\/TR\/xhtml2\/\" title=\"The latest XHTML2 spec\">XHTML2<\/a>, or more specifically, <a href=\"http:\/\/www.w3c.org\/TR\/2003\/WD-xhtml2-20030506\/\">XHTML2 Working Draft 6<\/a>.  I&#8217;ll admit that I haven&#8217;t done a good job slogging through the <a href=\"http:\/\/lists.w3.org\/Archives\/Public\/www-html\/\" title=\"Complete archive of the official www-html email list. HTML-lovin' Luddites need not apply.\">thousands of messages<\/a> on the <acronym title=\"Worldwide Web Consortium\">W3C<\/acronym> lists. I&#8217;m just a casual observer.<\/p>\n<p>Fortunately, there&#8217;s been plenty of weblog chatter over the <a href=\"http:\/\/www.zeldman.com\/daily\/0303a.shtml#objectx\" title=\"Jeffrey Zeldman: OBJECT of desire\"><code>&lt;object&gt;<\/code> replacing <code>&lt;img&gt;<\/code><\/a>, <code>&lt;cite&gt;<\/code> getting <a href=\"http:\/\/diveintomark.org\/archives\/2003\/01\/13\/semantic_obsolescence.html\" title=\"Mark Pilgrim: Semantic Obsolescence\">dropped<\/a> and then <a href=\"http:\/\/lists.w3.org\/Archives\/Public\/www-html\/2003Jan\/0130.html\" title=\"'Indeed it will be put back in the next draft.'\">added back<\/a>, the <a href=\"http:\/\/www.paranoidfish.org\/notes\/2003\/05\/13\/0954\" title=\"Paranoid fish: I want to use blockcode right now.  And I can't.\">excitement over <code>&lt;blockcode&gt;<\/code><\/a>, the <a href=\"http:\/\/tantek.com\/log\/2003\/05.html#L20030508t1620\">battle<\/a> over the <code>style<\/code> attribute, navigation lists, the new <code>&lt;h&gt;<\/code> and <code>&lt;section&gt;<\/code> model, the &#8220;<code>href<\/code> on everything&#8221; model, and more. The Alphas have been discussing these issues for months, and we Gammas have been well-served by just listening in.<\/p>\n<p>But even with all the healthy public discussion, XHTML2 is a <em>big<\/em> specification (<a href=\"http:\/\/www.w3.org\/TR\/xhtml2\/xhtml2.html\" title=\"The complete spec as one XHTML file\">430 KB<\/a> and counting). At least for my own edification, it&#8217;s time to see how deep the rabbit hole goes.<\/p>\n<h4>A Swarm of Attributes<\/h4>\n<p>XHTML2 provides a <em>huge<\/em> number of common attributes that are divided up into <dfn>collections<\/dfn>. Most XHTML2 elements accept attributes from <em>all<\/em> collections.  The most well-known example of this is the &#8220;everything is a hyperlink&#8221; concept, wherein you can turn any XHTML2 element into a link by applying the <code>href<\/code> attribute.<\/p>\n<p>But of course there&#8217;s much more. Consider the set of &#8220;common&#8221; attributes in HTML 4.01: there&#8217;s <code>id<\/code>, <code>style<\/code>, <code>class<\/code>, <code>dir<\/code>, <code>lang<\/code>, <code>title<\/code>, and the &#8220;event&#8221; attributes (such as <code>onmouseover<\/code>). This yields a little over 15 attributes, depending on how you&#8217;re counting. In contrast, XHTML2 <em>already<\/em> provides around 30 common attributes. Let&#8217;s take a closer look.<\/p>\n<h4>The Edit Collection<\/h4>\n<p><a href=\"http:\/\/www.w3.org\/TR\/xhtml2\/mod-attribute-collections.html#col_Edit\">The Edit Collection<\/a> provides an <code>edit<\/code> attribute with four allowed values: <code>inserted<\/code>, <code>deleted<\/code>, <code>changed<\/code>, and <code>moved<\/code>. Presumably if something is <code>moved<\/code>, you can specify <em>where<\/em> it moved to by using the <code>href<\/code> attribute. There&#8217;s also a <a href=\"http:\/\/www.w3.org\/TR\/xhtml2\/abstraction.html#dt_Datetime\"><code>datetime<\/code> attribute<\/a> for specifying the timestamp, the format of which is defined in <a href=\"http:\/\/www.w3.org\/TR\/2001\/REC-xmlschema-2\/\">XML Schema<\/a>, which references <a href=\"http:\/\/www.iso.ch\/markete\/8601.pdf\" title=\"ISO 8601\">ISO 8601<\/a>, which has since been <a href=\"http:\/\/www.intl-interfaces.com\/pipermail\/wms-dev\/2001-July\/000037.html\">revised<\/a>. <em>Whew<\/em>.<\/p>\n<p>The default presentation should be <code>display: none<\/code> for <code>deleted<\/code> markup, while the other three types should be displayed as-is.  Note that if we assume that the XHTML2 browsers of the future will have solid <acronym title=\"Cascading Style Sheets, Level 2\"><a href=\"http:\/\/www.w3.org\/TR\/REC-CSS2\/\" title=\"CSS2 specification\">CSS2<\/a><\/acronym> support, then we can write:<\/p>\n<pre>\n  *[edit=\"deleted\"] {\n    display: inline;\n    color: red;\n    text-decoration: line-through;\n  }\n<\/pre>\n<p>I&#8217;ll admit I like the idea of having a simple change record facility. However, there doesn&#8217;t appear to be an <code>editedby<\/code> attribute, which seems like a bit of an oversight.<\/p>\n<h4>The Embedding Collection<\/h4>\n<p>Through <a href=\"http:\/\/www.w3.org\/TR\/xhtml2\/mod-attribute-collections.html#col_Embedding\">the Embedding collection<\/a>, each element can have a <code>src<\/code> attribute. The browser attempts to replace the element&#8217;s content with the embedded file or resource. If the embedding fails for some reason, the browser proceeds to process the contents of the element. The spec provides an example involving a table:<\/p>\n<pre>\n  &lt;table <strong>src=\"temperature-graph.png\"<\/strong> type=\"image\/png\"&gt;\n    &lt;caption&gt;Monthly temperatures&lt;\/caption&gt;\n    ... (lots of table rows and cells) ...\n  &lt;\/table&gt;\n<\/pre>\n<p>The spec also declares,<\/p>\n<blockquote>\n<p>Note that this behavior makes documents far more robust, and gives much better opportunities for accessible documents than the <code>longdesc<\/code> attribute present in earlier versions of XHTML, since it allows the description of the resource to be included in the document itself, rather than in a separate document.<\/p>\n<\/blockquote>\n<p>I scratched my head over the new <code>src<\/code> attribute for a while&#8230; but if you think of it as a replacement for the <code>longdesc<\/code> attribute, then it <em>sort of<\/em> makes sense.   A couple of points, though.<\/p>\n<p>First, a quibble with the W3C&#8217;s example &#8212; I&#8217;m not quite sure how replacing a perfectly good XHTML table with a <acronym title=\"Portable Network Graphic\">PNG<\/acronym> image constitutes a great leap forward under any circumstances.<\/p>\n<p>Second, the W3C recommends:<\/p>\n<blockquote>\n<p>This collection causes the contents of a remote resource to be embedded in the document in place of the element&#8217;s content. If accessing the remote resource fails, for whatever reason (network unavailable, no resource available at the URI given, inability of the user agent to process the type of resource) the content of the element must be processed instead.<\/p>\n<\/blockquote>\n<p>Maybe I don&#8217;t understand this statement correctly, but I take the &#8220;instead&#8221; to mean that browsers should <em>not<\/em> continue to process content if the remote resource <em>is<\/em> accessible.  If so, I certainly hope that the browsers ignore this recommendation.  The browser doesn&#8217;t need to display the child content directly, but it needs to process the entire document and provide access to the child content <em>somehow<\/em>. Otherwise, accessibility gets worse, not better.<\/p>\n<p>Finally, this concept opens up all sorts of interesting UI issues.  Take the <code>&lt;table&gt;<\/code> example above.  If I use my browser&#8217;s &#8220;Find Text In This Page&#8221; function, will the browser search the text in the table cells? How will it highlight successful matches?<\/p>\n<h4>The Cite Attribute<\/h4>\n<p>The <a href=\"http:\/\/www.w3.org\/TR\/xhtml2\/mod-attribute-collections.html#col_Hypertext\">Hypertext collection<\/a> permits any element to have a <code>cite<\/code> attribute. At first glance, I thought that this made the <code>&lt;cite&gt;<\/code> element redundant. But as <a href=\"http:\/\/diveintomark.org\/\">Mark Pilgrim<\/a> points out in <cite><a href=\"http:\/\/diveintomark.org\/archives\/2003\/01\/13\/semantic_obsolescence.html\">Semantic Obsolescence<\/a><\/cite>:<\/p>\n<blockquote>\n<p>&#8220;No, the <code>cite<\/code> tag and the <code>cite<\/code> attribute are not the same thing.  The <code>cite<\/code> attribute is a <acronym title=\"Uniform Resource Locator\">URL<\/acronym>; the <code>cite<\/code> tag is wrapped around actual names within your text.&#8221;<\/p>\n<\/blockquote>\n<p>Fair enough.  However, I&#8217;ve been thinking that this might be an oversight on the part of the W3C, and the <code>cite<\/code> attribute should be allowed to contain arbitrary text.  For example:<\/p>\n<pre>\n  &lt;h1&gt;Ask Dr. Science!&lt;\/h1&gt;\n\n  &lt;p&gt;Q: Dr. Science, why is the sky blue? -- Ashley, age 8&lt;\/p&gt;\n\n  &lt;p&gt;A: Glad you asked, Ashley!  The answer is simple, really:&lt;\/p&gt;\n\n  &lt;blockquote\n    <strong>cite=\"Jackson, J.D. 1975. Classical Electrodynamics, 2nd. ed. \n          New York: John Wiley and Sons\"<\/strong>&gt;\n  &lt;p&gt;\n    The scattering of light by gases, first treated quantitatively by Lord\n    Rayleigh in his celebrated work on the sunset and blue sky, can be \n    discussed in the present framework.  Since the magnetic moments \n    of most gas molecules are neglible compared to the electric dipole\n    moments, the scattering is purely electric dipole in character.  In \n    the previous section we have discussed the angular distribution and\n    polarization of the individual scatterings (see Figure 9.6).  We \n    therefore confine our attention to the total scattering cross section\n    and the attenuation of the incident beam.  The treatment is in two \n    parts...\n  &lt;\/p&gt;\n  &lt;\/blockquote&gt;\n<\/pre>\n<p>The <code>cite<\/code> attribute provides an elegant way to scope sections of a document as belonging somewhere else, so why limit it only to stuff on the web?  As for the <code>&lt;cite&gt;<\/code> element, it would still be good for explicitly marking up citations (such as the ones found at the end of a journal article). Well, just a thought.<\/p>\n<h4>New LinkType Options<\/h4>\n<p>The <code>rel<\/code> attribute, once the sole province of the <code>&lt;link&gt;<\/code> element and <code>&lt;a&gt;<\/code> element, is now <a href=\"http:\/\/www.w3.org\/TR\/xhtml2\/mod-attribute-collections.html#col_Hypertext\">universal<\/a>. The allowed values are defined by the <a href=\"http:\/\/www.w3.org\/TR\/xhtml2\/abstraction.html#dt_LinkTypes\"><code>LinkType<\/code> data type<\/a>. There are three new options:<\/p>\n<ul>\n<li>\n<p><code>parent<\/code>: You may now specify a link as a parent document. Strangely, you can&#8217;t specify your <code>children<\/code> or <code>siblings<\/code>. After all, it&#8217;s kinda hard to construct a full tree without information about the children. Oh heck, let&#8217;s just say it: <em>won&#8217;t somebody think of the children?<\/em><\/p>\n<\/li>\n<li>\n<p><code>meta<\/code>: The link &#8220;provides metadata, for instance in RDF, about the current document.&#8221; This allows you to place your metadata directly in the body content of your document. Not sure why you would want to do this as opposed to using the good old fashioned <code>&lt;meta&gt;<\/code> tag, but ours is not to question why.<\/p>\n<p>Speaking of <code>&lt;meta&gt;<\/code> element, the spec states that &#8220;A common use for <code>meta<\/code> is to specify keywords that a search engine may use to improve the quality of search results. When several <code>meta<\/code> elements provide language-dependent information about a document, search engines may filter on the <code>xml:lang<\/code> attribute to display search results using the language preferences of the user.&#8221; The idea that people will provide accurate keywords in the first place, let alone scope these keywords appropriately according to language, seems a <a href=\"http:\/\/www.well.com\/~doctorow\/metacrap.htm\" title=\"Cory Doctorow: Metacrap\">quaint notion at best<\/a>.<\/p>\n<\/li>\n<li>\n<p><code>p3pv1<\/code>: When I first read this, the first thought that popped into my head was, &#8220;What&#8217;s the &#8216;v1&#8217; doing in there?&#8221; The second thought that popped into my head was, &#8220;What&#8217;s the <em>p3p<\/em> doing in there?&#8221; I have no idea why we would want to reference a particular technology here, let alone a particular <em>version<\/em> of a particular technology.  The W3C should rename this one to &#8220;<code>privacy<\/code>&#8221; post-haste.<\/p>\n<\/li>\n<\/ul>\n<p>Note: <strong><a href=\"\/Journal\/2003\/Jul\/#04\">Part II<\/a><\/strong> is now available.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>But even with all the healthy public discussion, XHTML2 is a <em>big<\/em> specification (430 KB and counting). At least for my own edification, it&#8217;s time to see how deep the rabbit hole goes.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-188","post","type-post","status-publish","format-standard","hentry","category-web"],"_links":{"self":[{"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/posts\/188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":0,"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.goer.org\/Journal\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}