Re: [gutvol-d] ANNOUNCEMENT: XML has hit the PG archives! (gutvol-d Digest, Vol

----- Original Message ----- From: "Lee Passey" <lee@novomail.net>
Joshua Hutchinson <joshua@hutchinson.net> wrote:
When in doubt, use <div>.
I've learned the fear the <div> container. Let me show you why using a <div> container for "non-specific" blocks of text won't work. <div> <head>Level 1</head> <p>Paragraph 1.</p> <div>Block o' text.</div> <p> Paragraph 2.</p> </div> *** The above will not validate. Once you go one deeper in a nest, you cannot come back up just one level. You have to close the whole nesting. The above would work if changed to: <div> <head>Level 1</head> <p>Paragraph 1.</p> <div>Block o' text.</div> </div> <div> <p> Paragraph 2.</p> </div> *** The problem is that now you have two distinct blocks of text that should really be treated as one block. *** NOTE: None of this is to argue that the more correct way to handle the example you gave would be to mark it as something other than <p> chunks. You are right there. Just that your counter example of <div> wouldn't work at all. Josh

I've learned the fear the <div> container. Let me show you why using a <div> container for "non-specific" blocks of text won't work.
<div> <head>Level 1</head> <p>Paragraph 1.</p>
<div>Block o' text.</div>
<p> Paragraph 2.</p>
</div>
Improperly nested tags will never validate. You can't have a bare string inside the <head> tag like that, and <head> isn't a child of <div>, so that won't work either. After correcting those errors, it validates fine.
The above will not validate. Once you go one deeper in a nest, you cannot come back up just one level. You have to close the whole nesting.
Nope, this is completely untrue.
The above would work if changed to:
<div> <head>Level 1</head> <p>Paragraph 1.</p>
<div>Block o' text.</div> </div>
<div>
<p> Paragraph 2.</p>
</div>
You're still producing invalid markup. Try something like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head><title>Level 1</title></head> <body> <p>Level 1</p> <div> <p>Paragraph 1.</p> <div>Block o' text.</div> <p> Paragraph 2.</p> </div> </body> </html> David A. Desrosiers desrod@gnu-designs.com http://gnu-designs.com

The people were talking about TEI here, not HTML, as in your example... in TEI <div> means a division of a text, not some ad-hoc container as in HTML. Jeroen. David A. Desrosiers wrote:
You're still producing invalid markup. Try something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

David A. Desrosiers wrote:
Improperly nested tags will never validate. You can't have a bare string inside the <head> tag like that, and <head> isn't a child of <div>, so that won't work either. After correcting those errors, it validates fine.
You are in the wrong picture! We are talking about TEI. You are talking about HTML. What Joshua says is true. Go to the TEI-L archives and search for "div tessellation problem". -- Marcello Perathoner webmaster@gutenberg.org
participants (4)
-
David A. Desrosiers
-
Jeroen Hellingman (Mailing List Account)
-
Joshua Hutchinson
-
Marcello Perathoner