<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title>validation · Grey Nicholson</title><id>https://gkn.me.uk/entries/validation</id><link href="https://gkn.me.uk/entries/validation" rel="alternate"/><link href="https://gkn.me.uk/entries/validation/feed" rel="self"/><author><name>Grey Nicholson</name></author><icon>https://gkn.me.uk/style/icon.svg</icon><updated>2025-10-21T12:11:00+00:00</updated>
<entry><title>On-the-fly page validation</title><id>https://gkn.me.uk/weblog034</id><link href="https://gkn.me.uk/weblog034" rel="alternate" type="text/html"/><published>2004-06-01T18:15:00+00:00</published><updated>2004-06-01T18:15:00+00:00</updated><content type="html">
&lt;p&gt;
I wonder if this is possible. I&#x27;ve been dabbling with JavaScript a little recently, in order to produce The Twaddle&#x27;s &lt;a href=&quot;http://purl.org/thetwaddle/expletatron&quot;&gt;Expletatron&lt;/a&gt; and this seems like something that should be possible with JS:
&lt;/p&gt;
&lt;p&gt;
I want a script that can load up a given remote page (internally - I don&#x27;t want to display the page, just to extract info from it), look at an element on that page with a given id, and return its class as a variable.
&lt;/p&gt;
&lt;p&gt;
What&#x27;s this got to do with validation? Well say the remote page was &lt;a href=&quot;http://validator.w3.org/check/referer&quot; title=&quot;The W3C Validator&#x27;s results for the referring page&quot;&gt;http://validator.w3.org/check/referer&lt;/a&gt; and the given id was &lt;samp&gt;result&lt;/samp&gt;. Then, if the returned variable is &lt;samp&gt;valid&lt;/samp&gt; (i.e. the class of that element is &lt;samp&gt;valid&lt;/samp&gt;) you&#x27;ve got a valid page; if the returned variable isn&#x27;t &lt;samp&gt;valid&lt;/samp&gt; you haven&#x27;t.
&lt;/p&gt;
&lt;p&gt;
So, you could, using JavaScript, whack in a “Valid XHTML” logo if, and only if, the page is actually valid. If you like, you could throw in an “Invalid!” image if the page is not valid.
&lt;/p&gt;
&lt;p&gt;
I know it&#x27;s possible to refer to an element by its id; I know it&#x27;s possible to get the &lt;em&gt;content&lt;/em&gt; of that element. I don&#x27;t know if it&#x27;s possible to get an element&#x27;s class, and I&#x27;m guessing it&#x27;s slightly impossible to do all this for another, remote page.
&lt;/p&gt;
&lt;p&gt;
It&#x27;d be nice though.
&lt;/p&gt;</content></entry>
<entry><title>Adventures in XML</title><id>https://gkn.me.uk/weblog028</id><link href="https://gkn.me.uk/weblog028" rel="alternate" type="text/html"/><published>2004-04-27T17:40:00+00:00</published><updated>2004-06-07T18:40:00+00:00</updated><content type="html">
&lt;p&gt;
I did manage to get the XML+XSL-based jiggery-pokery for The Twaddle working - quite nicely, actually. Getting the entire contents of the content field onto the page took a little bit of effort, as described &lt;a href=&quot;http://forums.mozillazine.org/viewtopic.php?t=71322&amp;amp;sid=7848e3b9bfb83d57adacdde5f19433e9&quot;&gt;on the mozillaZine forums&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I won&#x27;t be implementing this on The Twaddle, though - for a start, Opera and KHTML don&#x27;t like XSLT. And it&#x27;s not half as accessible for non-standard browsers (relics, mobile devices, text browsers...) as plain, extraneous-menu-items-and-such-written-into-the-article XHTML is. Nonetheless, a working example is online for the time being.
&lt;/p&gt;
&lt;p&gt;&lt;ins&gt;
Update: the real thing&#x27;s gone live... sort of... so the prototype has been removed. Additional related blurb is contained in &lt;a href=&quot;/weblog035&quot;&gt;a later entry in this weblog&lt;/a&gt;.
&lt;/ins&gt;&lt;/p&gt;
&lt;p&gt;
There&#x27;s a slight chance that I might implement an XML-driven article system on Mooquackwooftweetmeow, where I&#x27;m not too fussed about &lt;a href=&quot;http://microsoft.com/ie&quot;&gt;old and/or buggy browsers&lt;/a&gt;. The fact that mobile devices won&#x27;t render the page is more of a concern.
&lt;/p&gt;
&lt;p&gt;
Perhaps some way of pulling in external XHTML fragments could be handled in CSS3? Then again, why duplicate XSL functionality in CSS - small devices&#x27; browsers could just be taught to handle XSL.
&lt;/p&gt;
&lt;p&gt;
One more Twaddle-related thing: thanks to &lt;a href=&quot;http://www.quirksmode.org/css/condcom.html&quot;&gt;Internet Explorer conditional comments&lt;/a&gt; (on which MSDN has &lt;a href=&quot;http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp#Conditional_Comments_Terminology&quot;&gt;an hilarious article&lt;/a&gt;), I&#x27;m now feeding IE users &lt;a href=&quot;http://purl.org/thetwaddle/home/index.html#spur&quot;&gt;some nice propaganda in the foot of the front page&lt;/a&gt;:
&lt;/p&gt;
&lt;p&gt;
&lt;q&gt;You&#x27;re using Internet Explorer?! You do realise that it&#x27;s years out-of-date, and screws up most modern web pages, don&#x27;t you? In fact it&#x27;s screwing this one up right now and you don&#x27;t even know it. Try &lt;a href=&quot;http://www.mozilla.org/products/firefox/&quot;&gt;a proper web browser&lt;/a&gt; instead.&lt;/q&gt;
&lt;/p&gt;
&lt;p&gt;
Oh, and another tiny little piece of The Twaddle-related trivia: the version number on the front page is now in the title text of the &lt;a href=&quot;http://purl.org/thetwaddle/home/index.html#copyright&quot;&gt;copyright notice&lt;/a&gt; - it&#x27;s tidier and it leaves room for a pointless codename.
&lt;/p&gt;
&lt;p&gt;
Over to the Mooquackwooftweetmeow Weblog now, where, thanks to our old friend XML namespaces, and our newer friend &lt;a href=&quot;http://forums.mozillazine.org/viewtopic.php?t=71322&amp;amp;sid=7848e3b9bfb83d57adacdde5f19433e9&quot;&gt;the XSL &lt;code&gt;copy-of&lt;/code&gt; element&lt;/a&gt;, proper links are now in use. I&#x27;ve gone back through the weblog and updated plain text URLs to be links. The more observant of you will have noticed that there have been a smattering of links throughout this post - that&#x27;ll be the norm from now on.
&lt;/p&gt;
&lt;p&gt;
The even more observant of you will have noticed line breaks as well. I&#x27;d use paragraphs but the XSL stylesheet inserts the content into a paragraph - I don&#x27;t think the &lt;a href=&quot;http://validator.w3.org&quot;&gt;XHTML validator&lt;/a&gt; would like paragraphs within paragraphs (not that it&#x27;d like this Atom file at all...). And I don&#x27;t think the site&#x27;s CSS would like &lt;code&gt;div&lt;/code&gt;s to hold the text, in place of paragraphs; it might - I just haven&#x27;t looked at mqwtm&#x27;s CSS in ages so I can&#x27;t remember. Besides, line breaks are lighter on the markup than open-and-close &lt;code&gt;&amp;lt;xhtml:p&amp;gt;&lt;/code&gt; tags.
&lt;/p&gt;
&lt;p&gt;
And in a final twist of XMLish loveliness, I&#x27;ve chucked a few XHTML &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt; tags in as well.
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;&amp;lt;/epic&amp;gt;&lt;/code&gt;
&lt;/p&gt;</content></entry>
<entry><title>Namespaces are fairly fun</title><id>https://gkn.me.uk/weblog007</id><link href="https://gkn.me.uk/weblog007" rel="alternate" type="text/html"/><published>2004-02-19T18:30:00+00:00</published><updated>2004-04-27T17:40:00+00:00</updated><content type="html">
&lt;p&gt;
The Feed Validator (&lt;a href=&quot;http://feedvalidator.org&quot;&gt;http://feedvalidator.org&lt;/a&gt;) gave me a thumbs-down :( Entries&#x27; IDs have to be valid URLs, you see, and I&#x27;d been using them as arbitrary labels. I&#x27;d also been leeching off these arbitrary labels in order to create anchors in the XHTML representation of the feed; those using a web browser can check they work by clicking this item&#x27;s title; those using a news aggregator can visit the alternate link; in both cases, the item&#x27;s title should be at the very top of the browser window.
&lt;/p&gt;
&lt;p&gt;
I managed to circumvent Atom&#x27;s rigidity using XML&#x27;s flexibility - I invented a new arbitrary label for each item - &lt;code&gt;label&lt;/code&gt;, under my own namespace; I now have everything working as before, plus a valid feed. Glory!
&lt;/p&gt;
&lt;p&gt;
I think I&#x27;ll go and play a bit of pool now...
&lt;/p&gt;</content></entry>
</feed>