mod_publisher is the universal markup processing module. It builds on WebÞing's experience with smart markup processing, in particular the SAX-based filters such as mod_accessibility, mod_proxy_html, mod_xmlns, and mod_annot. It supports both HTML and XML input, and works equally well in a server or in a proxy situation.

Not only is mod_publisher fast, powerful, and compatible with your web applications; it is also 100% markup-based, and will generate valid markup, even from complex edits, insertions or substitution of remote or database contents. Add almost unlimited extensibility through namespace modules, and complex publishing needs are now definitively compatible with clean, valid webpages!

Figure 1

Figure 1 shows mod_publisher in context, as a multipurpose filter between the content generator and the client. The content generator may be more-or-less anything; a few popular options are suggested. To the left are shown mod_publisher's builtin capabilities: Macros, Rewrites, DTD-based corrections and SSI. To the right are shown the APIs for extending mod_publisher.



Tutorial and Example-based introductions to different aspects of mod_publisher.

Rule-based Markup Rewriting
This extends the URL-rewriting of mod_proxy_html, with fine-grained control of search-and-replace rewrites of URLs, events, attributes, comments, CDATA sections (scripts and stylesheets), and body text.
Macros & Templates
Elements may be defined as having special processing: they may be rewritten, generate an automatic insertion, or blanked. Custom elements may be used as an alternative to SSI. Whereas rewrite rules edit text (contents of markup), macros operate on markup itself and may be used for large-scale rewrites, or even to splice up and include pages from other servers.
Comment Parsing and SSI
Comments may be deleted, left intact, rewritten using rules, or processed as Server-Side Includes. SSI extensions include the capability to #include contents fetched by URL from a remote server.
XML API and Namespace support
mod_publisher supports XML Namespace modules such as mod_xhtml, mod_proxy_xml and mod_annot, and a general SAX API. Note that mod_publisher is an alternative to mod_xmlns, and should not be used together in the same server.
DTD support and Markup Correction
Markup can be processed to a DTD. A DTD can for example be used to ensure that output is compatible with (or optimised for) a particular client device, or to correct the output of a content generator.
Parser Options
mod_publisher uses libxml2 to parse markup. It will select HTML or XML parse mode according to the content-type being served. For XML, it will use SAX2 parsing if namespace support is required.


Current status is in testing. Reports are mixed, but there are credible reports of it failing, so it's some way from release-quality.

Version 0.3.2

Feb. 27th 2005: mod_publisher is now at 0.3.2 for Linux, FreeBSD and Windows (linux and freebsd compiled with debug; windows without). Releases are subject to frequent change, but properly versioned. If you are actively testing it, please let us know what you're doing and how well it works (or doesn't work) for you. Please return regularly for updates!

Version 0.3.2 for httpd 2.1

mod_publisher is now available for httpd-2.1 (alpha) on Linux.


A build for Linux is available here. It's slightly modified from what's documented here. Work is in progress on a major update.