Re: CAPTION in FIG element

lilley (lilley@afs.mcc.ac.uk)
Thu, 16 Mar 1995 19:57:37 +0000 (GMT)

Terry Allen promptly replies:

> I can't duplicate your error when I wrap up your first example so:

> <!doctype html system "html.3.dtd">
> <html><head><title>foo</title>
> </head><body>
> <FIG SRC="url"><CAPTION>Figure 1: something</CAPTION>
> <P>Hello, you can't see my pretty picture</P>
> </FIG>
> </body></html>

Which version DTD are you validating against and with what tools?

> But when I tried your second example I found there was pernicious mixed
> content (and you left out a required SRC att on FIG).

Hey, Dave left it out (or rather, mistakenly typed HREF instead of SRC), I
commented on it!

> The following parses okay:
>
> <!doctype html system "html.3.dtd">
> <html><head><title>Tester</title></head>
> <body><h1>Tester</h1>
>
> <FIG src="nicodamus.jpeg"><CAPTION>Ground dweller: <I>Nicodamus bicolor</I>
> builds silk snares</CAPTION><P>A small hairy spider light fleshy red in color with a brown abdomen.<CREDIT>J. A. L. Cooke/OSF</CREDIT></FIG>
>
> </body></html>

Right, I copied pasted this into a file and altered system to the usual PUBLIC
(I get an error with system, it's not in my catalog).

With (Draft: Wed 01-Mar-95 09:08:15) I get:
cguhpc [73]: !!
html-check ta.html
ta.html ...
... valid

> Also note that line 552 in the 13 March DTD should be
>
> <!ELEMENT PRE - - (%text;)* -(%pre.exclusion)>

Cheers, that has fixed it.

Now to my example (and this is gross and surely is a mistake?)

This gives an error:

<FIG src="c-chart.gif">
<caption align=bottom>Figure 1: An example natal chart.</caption>

cguhpc [80]: html-check tmp.html
tmp.html ...
sgmls: SGML error at tmp.html, line 9 at ">":
FIG end-tag implied by CAPTION start-tag; not minimizable
sgmls: SGML error at tmp.html, line 9 at ">":
Out-of-context CAPTION start-tag ended HTML document element (and parse)

Removing the line break between the close of FIG and the start of CAPTION
meant the file was declared valid.

<FIG src="c-chart.gif"><caption align=bottom>Figure (etc)

The error messages were less than helpful in spotting this. Is there anything
that can be done to stop this, or does SGML's handling of whitespace leave
something to be desired?

--
Chris Lilley
+-------------------------------------------------------------------------+
| Technical Author, Manchester and North HPC Training & Education Centre  |
+-------------------------------------------------------------------------+
| Computer Graphics Unit,        |     Email: Chris.Lilley@mcc.ac.uk      |
| Manchester Computing Centre,   |     Voice: +44 61 275 6045             |
| Oxford Road,                   |       Fax: +44 61 275 6040             |
| Manchester, UK.  M13 9PL       |      X400: /I=c /S=lilley              |
|                 /O=manchester-computing-centre /PRMD=UK.AC /ADMD= /C=GB/|
|<A HREF="http://info.mcc.ac.uk/CGU/staff/lilley/lilley.html">my page</A> | 
+-------------------------------------------------------------------------+
|This is supposed to be data transfer, not artificial intelligence. M VanH|
+-------------------------------------------------------------------------+