{"id":364,"date":"2007-04-08T10:34:02","date_gmt":"2007-04-08T00:34:02","guid":{"rendered":"http:\/\/www.somethinkodd.com\/oddthinking\/2007\/04\/08\/what-are-the-correct-dtd-incantations\/"},"modified":"2007-10-07T19:54:02","modified_gmt":"2007-10-07T09:54:02","slug":"what-are-the-correct-dtd-incantations","status":"publish","type":"post","link":"https:\/\/www.somethinkodd.com\/oddthinking\/2007\/04\/08\/what-are-the-correct-dtd-incantations\/","title":{"rendered":"What are the correct DTD incantations?"},"content":{"rendered":"<p>Dear Web,<\/p>\n<p>I am having trouble getting my head around a new technology, and I just needed someone to take it through with, until I understand.<\/p>\n<p>If I can explain my problem clearly, perhaps I will see the solution myself &#8211; or at least get the part of my brain that comes up with solutions in the shower to start thinking about it.<\/p>\n<hr \/>\n<p>In the EmailShroud 2.0 plugin, I use a couple of non-standard attributes on the anchor tag.<\/p>\n<p>While that means it doesn&#8217;t validate, I expect everyone&#8217;s browser to ignore the attributes they don&#8217;t understand; I was happy to deliver with that.<\/p>\n<p>I didn&#8217;t even bother to fix it in EmailShroud 2.1 (currently being alpha tested on this site &#8211; <a   rel=\"nofollow\" id=\"sto_emailShroud0\" href=\"http:\/\/www.somethinkodd.com\/emailshroud\/emailaddress.php?encryptedAddress=moc%40%40duorhsliame.ddoknihtemos&amp;ver=2.2.1\">let me know<\/a> if you see any odd behaviour).<\/p>\n<p>However, now I am looking at cleaning it up and ensure it exhibits nothing but pure validation goodness for the release after next.<\/p>\n<h4>Option 1<\/h4>\n<p>I could remove the use of custom attributes, and try to tunnel the same information through existing attributes, such as class or id. It might be possible to get this to mostly work, but it would be not The Right Thing&#8482;.<\/p>\n<p>I need to weave some <acronym title=\"Document Type Definition\">DTD<\/acronym> magic here. Let&#8217;s get the incantations ready.<\/p>\n<h4>Option 2<\/h4>\n<p>I could reference the external DTD, and then add some extra attributes with an additional &#8220;Internal DTD&#8221;, i.e. add the extra attributes via incantations on each page. <\/p>\n<p>This works in Opera, but Firefox and IE7 leave an unsightly &#8220;]>&#8221; mess at the top of the page. [<a href=\"http:\/\/alistapart.com\/articles\/customdtd\/\">Ref<\/a> + testing] It seems odd that they both have the same bug &#8211; have I missed something here?<\/p>\n<h4>Option 3<\/h4>\n<p>I could find the original DTD for XHTML and modify it to include the new attributes. Then I could host it on SomethinkOdd, and have the plugin point to this DTD in the header of each HTML.<\/p>\n<p>This idea has several flaws.<\/p>\n<ul>\n<li>\nThe plugin would need to locate the old value for the DTD in the page and insert the new one. WordPress&#8217;s architecture gives plugins many hooks to insert their own &#8220;filters&#8221; in the stream, to modify parts of the page (EmailShroud is built on this technology.) However, the DTD link is owned by the theme, I don&#8217;t believe it is passed through any filters before being sent out. Ergo, I would have to make the end-user modify their theme file manually if they wanted their page to validate.<\/p>\n<div class=\"aside\">\n<p>Hmm&#8230;. I&#8217;ve just realised this would also impact option 2<\/p>\n<\/div>\n<\/li>\n<li>There are at least nine different public standard DTDs for web-pages [<a href=\"http:\/\/www.w3.org\/QA\/2002\/04\/Web-Quality\">Ref<\/a>], and I would need to support at least four of them (XHTML 1.1, XHTML 1.0 Strict, XHTML 1.0 Transitional, HTML 4.01 Strict). That&#8217;s starting to pile up. What&#8217;s more, I can&#8217;t assume that some other plugin isn&#8217;t making similar demands on the user. What if <em>both<\/em> plugins demand you change the theme?<\/li>\n<li>I do <strong>not<\/strong> want every EmailShroud-protected web-page to trigger a fetch of a DTD from my site. Too much bandwidth, too little revenue! So now I need to work out how to get the plugin to serve its own DTD files (feasible) and get the user to point to the right one (tricky).<\/li>\n<li>The W3C Validator will decline to validate DTDs outside the well-known public ones. [<a href=\"http:\/\/alistapart.com\/articles\/customdtd\/\">Ref<\/a>] While it might be secretly well-formed, it will be hard to prove to people.<\/li>\n<\/ul>\n<p>Put together, these flaws suggest to me that I am headed towards either a failure to deliver &#8211; or even worse &#8211; a successful delivery plus a world of pain in support.<\/p>\n<h4>Option 4<\/h4>\n<p>So what is option 4?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the EmailShroud 2.0 plugin, I use a couple of non-standard attributes on the anchor tag.<\/p>\n<p>Now, I am looking at cleaning it up and ensure it exhibits nothing but pure validation goodness&#8230;<\/p>\n<p>I just don&#8217;t know how.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[32,25,34],"tags":[84,69,95],"class_list":["post-364","post","type-post","status-publish","format-standard","hentry","category-about-oddthinking","category-insufficiently-advanced-technology","category-software-development","tag-oddthinking","tag-software","tag-web"],"_links":{"self":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/comments?post=364"}],"version-history":[{"count":0,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/364\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/media?parent=364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/categories?post=364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/tags?post=364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}