Forum Moderators: open

Message Too Old, No Replies

blockquote validation issue

html 4.01 strict

         

tedster

11:15 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've been pushing myself to write strict, not transitional, HTML all the time. I figure I might as well break all the habits I have that won't go forward.

So I'm struggling with this error I'm getting from the W3C validator.

Line 58, column 12: end tag for "BLOCKQUOTE" which is not finished

When I click the "Explain" link I get this:

You have a ‘FOO’ element, but you have omitted some required sub-element of it. For instance, a TABLE with no TR's would cause this error.

So what is the required sub-element of blockquote? I've googled myself crazy, searched in O'Reilly, and I turn up nothing.

For now I've abandoned the blockquote element and turned it into a div -- but dang it, it actually IS a quote.

BlobFisk

11:28 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unusual one, tedster. Truth be told, I've never tried using blockquote in an html4.01 strict page. How are you using it?

<blockquote cite="http://some.site.com">
<p>Some quotation from the cite site!</p>
</blockquote>

Interestingly, using the blockquote element as a method for indenting text was deprecated in html4.01

mipapage

11:34 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure how much this helps, but I've had similar errors when validating (x)html, usually ommiting the end tag of a meta or image tag:

<img stuff here... >

vs.

<img stuff here... />

Maybe this helps?

BlobFisk

11:38 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey tedster,

I stuck the blockquote code from my previous post into a html4.01 strict page (nothing else on the page) and it validated fine.

Then I removed the <p> and </p> tags and it threw up errors. Have you tried surrounding the quotation text with <p> tags?

mipapage: The trailing "/" is fof XHTML, I don't think that it's at all necessary in HTML4.01...

tedster

11:44 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think that must be it -- <p> tags are required ina <blockquote>. But that gets into cross browser rendering issues that I didn't want to mess with. Oh, well.

Funny thing is both <p> and <blockquote> are block elements. And a <p> cannot contain a <blockquote> -- except that rule may change in XHTML 2.0

BlobFisk

11:48 am on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That was my initial reaction too, but we nest <p>'s within <div>'s and both are technically block level elements.

Perhaps <div>s and <blockquote>s are seen as higher level block elements?

<edit>Typo Fix</edit>

[edited by: BlobFisk at 12:21 pm (utc) on June 20, 2003]

tedster

12:08 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Curiouser and curiouser:

[w3.org...]

SuzyUK

12:18 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I found this out too..

I'll have to see if I can find the reference but the gist of it is that

<blockquote> has to surround any other block level element in order to validate...

I see if I can find the source of this reference to clarify

Suzy

SuzyUK

12:26 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually it just makes sense semantically

a <blockquote> is just that it is a quote of text that could be several paragraphs / images in length so there would need to be a way of still formatting the paragraphs or images within those quotes.

if its purpose was just to quote one line of text then the <cite> or <q> tag would be more semantically correct

Suzy

BlobFisk

12:34 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think that you've hit the nail on the head there Suzy!

drbrain

4:34 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep! Suzy is right. Look at this fragment of the strict HTML4.01 DTD [w3.org]:

<!ELEMENT BLOCKQUOTE - - (%block;¦SCRIPT)+ -- long quotation -->

The Blockquote element must contain one or more of an element from %block; [w3.org], or the SCRIPT element.

berli

5:24 pm on Jun 20, 2003 (gmt 0)

10+ Year Member



Weird!

I'm glad I found this discussion because when I read up on html4.01 I misunderstood and thought that blockquote elements could no longer contain p's.

<runs off to fix some code>

papabaer

7:30 pm on Jun 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Suzy is absolutely correct...

Think about it: block-quote.

The element IS constructed to contain a "quote-block," Which can be a single sentence, or several paragraphs.

It will be interesting when XHTML2 redefines the paragraph...