Re: Structure vs Semantics

Lachlan Hunt wrote:
> 
> Chris Mannall 2003-12-11:
> 
>> A "block" quote can be defined not only by what it contains (which,
>> as you say, can't be represented by a CSS selector), but also by what
>> it is contained by.  An "inline" q element would tend to be a
>> descendent of a p element; a "block" q element would not. This would
>> seem to be handled by the following CSS rules:
>>
>> q { display:block; }
>> p q { display:inline; }
> 
> 
>   Although this idea would need quite a lot of refinement, this 
> indicates that it may, infact, be possible to determine the nature of an 
> element as being block or inline from the context of the element's use. 
>  However, as Ernest points out in his reply, that this may not be so 
> simple.
> 
> Ernest Cline 2003-12-11:
> 
>> Yes and no.  While the tendency is for quotes in a paragraph to be
>> inline, they can be block which is one reason the current draft makes
>> the needed improvement of adding blockquote to the content model
>> of p.  And for div we have  in my opinion a roughly equal expectation
>> of encountering either block or inline quotes.
>> OTOH,  as far as a blockquote inside a paragraph is concerned,
>> the block nature there is largely a matter of presentation save for
>> one critical distinction: the punctuation characters used differ in the
>> two contexts. (at least in English they do)  If we leave the block/inline
>> distinction to styling, we'll have to revert to having UA's adding
>> appropriate quotation marks as per the <q> element instead of
>> adopting the simpler handling of the proposed <quote>.
> 
> 
>   As Ernest correctly points out, the block or inline nature of a quote 
> may be presentational, however he also states that the quotes used also 
> differ and that these may not simply be a presentational issue.


Inline quotes and standalone block quotes are covered by the limited CSS 
rules that I gave previously - the problem that Ernest mentions, of 
blockquotes inside paragraphs, is also solvable with CSS.

Consider the following:

<p>This is a paragraph, that contains the following "block" quote:
	<q>blah blah blah blah blah blah blah blah </q>
</p>

The issue here is that there is no way of "knowing" via CSS selectors 
that this is a block quote. However, the reason for this, IMHO, is that 
the example above is flawed. Consider next the following:

<p>This is a paragraph, that contains the following "block" quote:
	<q>
		<p>blah blah blah blah blah blah blah blah</p>
		<p>blah blah blah blah blah blah blah blah</p>
	</q>
</p>

Because I have now quoted two paragraphs, it is possible to style this 
appropriately. We now "know" that this is a blockquote since it contains 
paragraphs: the remaining problem is that we don't have a CSS selector 
that allows us to select an element *based on it's children*... but that 
is irrelevant, because we can approach it by styling the paragraphs 
themselves:

	q p { margin-left:30px; margin-right:30px; }

This says that paragraphs that are part of quotations should be indented.

So the CSS rules we have now are:

	/* The "default": quotes are block */
	q { display:block; }

	/* But quotes inside paragraphs are inline: */
	p q { display:inline; }

	/* And quotes containing paragraphs are inline, but their
	   contents are block and should be indented: */
	q p { margin-left:30px; margin-right:30px; }

This means that my first example might be better marked-up as:

<p>This is a paragraph, that contains the following "block" quote:
	<q><p>blah blah blah blah blah blah blah blah</p></q>
</p>

Note that I haven't yet covered Ernest's other issue, the matter of 
quotemarks. Although I agree that this is an issue, I also believe that 
Ernest is missing something - namely, that it isn't enough to simply 
surround our quote element with quotemarks. An example of why:
	
	"Here, I'm quoting a speech. The speaker is presenting a number of 
ideas, that each have their own paragraph.
	"Note that each paragraph opens with a quotemark, but only the final 
paragraph needs a closing quotemark."

In XHTML, this would be written as:

	<q>
		<p>Here, I'm quoting...</p>
		<p>Note that each...</p>
	</q>

If you look at how we need to style this, you'll see that we really need 
to style the individual paragraphs. To represent this in CSS we need to 
make use of the CSS3 :last-child selector:

	q p:before {
		content:quotes;
	}

	q p:last-child:after {
		content:quotes;
	}

(I apologise if the syntax I've used isn't quite correct; I haven't made 
much use of these facilities prior to now.)

>   While the quotes do differ, do they provide any additional semantic 
> value to the reader.  Both forms indicate a quotation, and as such, the 
> different quotes may just be a presentational convention, which can be 
> handled through CSS.

I would agree that the type of quotemarks used is largely a 
presentational matter... this is evidenced by the fact that there are 
differences in quotemarks in different languages. A quote is a quote is 
a quote, regardless of whether it is contained within a document in 
French or one in English... the semantics aren't changed. Thus it 
follows that which quotemarks are used isn't an issue of semantics, but 
of presentation.

There is also the fact that how to quote longer passages is a matter of 
convention: I outlined above one such convention, that of putting 
quotemarks at the start of each quoted paragraph, but only at the end of 
the *final* paragraph - there is also another convention that I see 
quite frequently, which is that long "block" quotes don't have 
quotemarks at all. Again, this suggests that it isn't an issure of 
semantics, but of how people choose to *present* their quotations.

Finally, a further difficulty which can't be resolved is that there are 
differing conventions on whether to include punctuation within quotations:

	Was so-and-so correct when he said "such and such?"

	Was so-and-so correct when he said "such and such"?

This could be seen as solvable by either including the question mark in 
the <q> element or not, but I don't think it's as simple as that. The 
question mark isn't part of the quotation, so I don't see that it should 
be included in the <q> element, but I may still wish to *present* the 
quotation in the first form.

>   As for the point about <div> as the parent element of a quote, perhaps 
> the decision could be made to make the *default* presentation of 
> elements such as quote, block in such situations where either block or 
> inline is equally likely, and inline for where there is a tendency of 
> usually being inline, such as within <p>.  However, since this would be 
> a presentational issue, if the default style is incorrect, the author is 
> able to apply CSS to correct it.
> 
> 
> Ernest Cline 2003-12-10:
> 
>> The problem is that with the structure of XML, it is impossible to
>> allow <a><b/></a> and <b><c/></b> while banning <a><b><c/></b></a>.
>> (At least via an XML DTD there is no way to do this. Does XML
>> Schema or Relax NG provide a mechanism to do this?)

This is a limitation of DTDs, not a problem with the proposed content 
model. Note that there are already a number of limitations with DTDs 
that are being encountered as XHTML evolves, not least of which is the 
complexity involved in creating modular DTDs as seen with Modular XHTML 
and now with the need to integrate XHTML and XForms (and potentially 
XLink, and SVG, and...)

I don't think the inability to express something in a DTD should be seen 
as a reason not to take that direction: rather as an argument for 
dropping DTD support and moving to more sophisticated mechanisms for 
document validation.

>> Thus, with the proposed model we would have to accept
>> <em><quote><div/></quote></em> even tho we
>> don't want <em><div/></em>.
>
> (The proposed model is referring to that which I proposed earlier, on 
> the same day)
> 
>   Ernest has raised quite a good point about the content models, but the 
> question is, that even though structures like <em><div/><em> are 
> semantically incorrect, is there no case where 
> <em><quote><div/></quote></em> would be semantically correct?
 >
> eg. If the <quote> was infact large enough to be block quote, and was 
> presented as such through CSS, then it could well be semantically correct.

Quite. The situation seems a bit odd to me.

If the only difference between a "block" quote and an "inline" quote is 
what they're allowed to contain, then surely we can *deduce* whether an 
instance of a quote element is block or inline based on its content?

>   This could be an argument for keeping the distinction between block 
> and inline elements like <blockquote>/<quote>, yet not if the difference 
> between the two is just presentational.
> 
> CYA
> ...Lachy!
> 
> [1] http://www.w3.org/TR/2003/WD-xhtml2-20030506/mod-block-text.html
> [2]
> http://www.w3.org/TR/2003/WD-xhtml2-20030506/mod-block-text.html#sec_8.3.
> [3]
> http://www.w3.org/TR/2003/WD-xhtml2-20030506/mod-inline-text.html#sec_9.8.
> [4] http://www.w3.org/TR/html401/struct/global.html#h-7.5.3

Received on Thursday, 11 December 2003 12:08:48 UTC