ceegeye xhtml notes

CeeGeye uses (or tries to) xhtml version 1.0 Strict.
This means that it uses this at the opening of all its html output

<?xml version="1.0" encoding="UTF-8"?>
<!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" xml:lang="en" lang="en">

The xhtml class tries to help guard against simple xhtml snafus, e.g. in a debug build ( where NDEBUG is not defined ) any tag will assert if not nested correctly. This should show up in the web server logs and possibly the page will not render completely. e.g.

tail -n1 /var/log/apache/error.log
 webpage.cgi: ceegeye/xhtml.cpp:894: void ceegeye::xhtml::divend( ): Assertion `tag == "</div>"' failed.

This shows that the cgi webpage.cgi has asserted because a tag was called out of order, i.e. incorrect nesting This could happen like this:

CGI cgi;
xhtml p(cgi);
p.pagebegin("The Title");
p.body( );
p.div( );
p << "blah blah";
p.p( );
p.divend( ); // oops ASSERTION p.pend( );

The call to p.divend( ) will assert as it was called before the paragraph tag was closed.
All tags that do not have a closing tag are guarenteed to be closed e.g. h1(“my heading”), as long as the destructor calls, i.e. no assertions.

As at the current time this is the extent of xhtml’s checking it doesn’t protect you against other xhtml snafu’s e.g. placing text on a page outside of an allowed tag. See http://www.W3.org for xhtml specifics. There are plenty of tutorials on the web and in your local bookstore on the differences between xhtml and html, remember currently the xhtml class uses xhtml version 1.0 strict.
To test whether a page that ceegeye produces is xhtml compliant use the W3’s validation service, or HTML Tidy

Check the demo pages on how to use cascading style sheets with the library.