Validating docbook articles...

Chuck Swiger chuck at pkix.net
Wed Jan 21 00:13:05 UTC 2004


Hi, all--

I've noticed a few issues trying to validate HTML generated via the  
FreeBSD Docbook infrastructure, using the tools from W3C.org.  While I  
noticed this checking on an article I'd written myself, the same issues  
I've noticed also seem to affect content like:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/

Feeding that URL to the W3C validator (apologies for an URL that will  
wrap):

http://validator.w3.org/check? 
uri=http%3A%2F%2Fwww.freebsd.org%2Fdoc%2Fen_US.ISO8859-1%2Fbooks%2Ffdp- 
primer%2F

...complains that no valid character encoding is present.  How does one  
convince Docbook to place something like:

	<meta http-equiv="Content-Type" content="text/html;  
charset=iso-8859-1" />

...into the <head> section of the resulting XHTML, or else generate an  
XML declaration containing an encoding type in the document prolog?

	--

The W3C validator lets one override the character encoding, and doing  
so lets the tool proceed, but this uncovers another possible issue:

Below are the results of attempting to parse this document with an SGML  
parser.
	 1.  	Line 618, column 15: value of attribute "align" cannot be  
"LEFT"; must be one of "left", "center", "right" (explain...).
   <hr align="LEFT" width="100%" />

The XHTML spec defines the attributes of the hr element as:

<!ELEMENT hr EMPTY>
<!ATTLIST hr
   %attrs;
   align       (left|center|right) #IMPLIED
   noshade     (noshade)      #IMPLIED
   size        %Pixels;       #IMPLIED
   width       %Length;       #IMPLIED
   >

...so I'm willing to believe the W3C validator is right, and that  
Docbook should be generating these attribute values in lower case.   
This problem affects a number of other elements, such as img, h1-h6,  
and so forth which use the ImgAlign or TextAlign attributes.

-- 
-Chuck

PS: Yes, I know that elements and attribute names used to be  
case-insensitive, but section 4.2 of the XHTML spec says otherwise.   
And yes, I am picking nits.  The question is, am I picking useful  
nits...?  :-)



More information about the freebsd-doc mailing list