mod_xhtml provides a namespace processor for http://www.w3.org/1999/xhtml that serves to ensure XHTML meets the W3C Appendix C guidelines for compatibility with HTML browsers and the text/html MIME type. In addition, mod_xhtml implements Server Side Includes (SSI), both as Apache's comment-driven processing language and as a separate XML namespace processor.
The mod_xhtml SSI implementation is simpler than Apache's traditional mod_include, in that it decouples the task of markup parsing from SSI processing. Most importantly, as a namespace processor, it plugs directly in to general XML-based publishing systems, without the overhead of having to parse the markup twice.
mod_xhtml actually provides two ways to implement SSI:
<!--#directive arg="val"-->
<ssi:directive arg="val"/>
The two are exactly equivalent and are implemented by the same code. They can be enabled separately or mixed in a single document.
The principal limitation in mod_xhtml is in what it works on. Unlike mod_include, it requires its input to be well-formed XML, and cannot be used on HTML4 or tagsoup input.
The SSI implementation is also incomplete:
Much of the SSI implementation is based on mod_include, and mod_xhtml includes a substantial amount of copied code.
As with any namespace module, using mod_xhtml is based on inserting the xmlns filter from mod_xmlns or mod_publisher: e.g.
LoadModule xmlns_module modules/mod_xmlns.so AddOutputFilter xmlns .html
orLoadModule publisher_module modules/mod_publisher.so AddOutputFilter markup-publisher .html
There are three namespace providers we can use, and several different usages. Note that if you use mod_publisher, much of this is redundant, and only the SSI namespace (the last example) provides functionality over and above what's builtin.
XMLNSUseNamespace http://www.w3.org/1999/xhtml on 1.0
XMLNSUseNamespace http://www.w3.org/1999/xhtml on ssi
XMLNSUseNamespace http://apache.webthing.com/ssi# on ssi
XMLNSUseNamespace http://www.w3.org/1999/xhtml on 1.0
XMLNSUseNamespace http://apache.webthing.com/ssi# on ssi
XMLNSUseNamespace http://www.w3.org/1999/xhtml on 1.0
XMLNSUseNamespace http://apache.webthing.com/ssi# on ssi
mod_xhtml implements three configuration directives. These set processing defaults that can be overridden in a document by the SSI config directive. They all work as documented under mod_include's config directive.
mod_xhtml is available under the GNU General Public License (GPL). As with other opensource modules, alternative licenses may be considered by request.