W3C home > Mailing lists > Public > www-validator@w3.org > August 2007

Re: Error in XHTML Validator???

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Mon, 20 Aug 2007 14:57:45 +0300 (EEST)
To: Brian Timmins <brtimmins@googlemail.com>
cc: www-validator@w3.org
Message-ID: <Pine.SOC.4.64.0708201451530.12055@mustatilhi.cs.tut.fi>

On Mon, 20 Aug 2007, Brian Timmins wrote:

>> <textarea cols="82" rows="1">
>>> <a href="http://www.brianstimelines.co.uk/index.html">Brian's Timelines:
>>> Home Page</a>
>>> </textarea>
>>
>> According to the HTML4 (and thus XHTML 1.0), the textarea element can
>> only take PCDATA content, in other words, "plain text, no child
>> element".
>
> OK. So how does one present code snippits on a webpage?

That's more of an authoring issue than a validation problem, but briefly 
the principle is to encode each "<" as "&lt;" and each "&" (in data) as 
"&amp;". In addition to this, and independently of it, it is logical to 
use <code> markup, since HTML markup is "computer code" in a broad sense. 
This also makes browsers use a monospace font, even in the absence of a 
style sheet. Thus, you could write

<code>&lt;a 
href="http://www.brianstimelines.co.uk/index.html">Brian&#8217;s 
Timelines:>Home Page&lt;/a></code>

(Using &#8217;, the "typographer's apostrophe", instead of ' is 
independent of the other issues and mainly a typographic thing.)

Problems with HTML markup in general are perhaps best discussed in
news:comp.infosystems.www.authoring.html

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Monday, 20 August 2007 11:57:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:25 GMT