I've been working with DocBook XML content a lot lately and found it quite inconvenient that I had to transform it to HTML before being able to view it. As furthermore Konqueror (resp. KHTML) is still lacking support for embedded XSLT stylesheets, I started to poke at it. As a preliminary result I present you an XSLT plugin for Konqueror.
The mechanism is actually quite (mostly) simple:
- Check if the current document either has an <?xml-stylesheet?> directive or is of known type (currently only DocBook 5.0)
- Load the respective styles (and try to avoid Xml eXternal Entity vulnerabilities)
- Pipe the document through libxml and libxslt with libexslt (unfortunately QtXmlPatterns doesn't support everything needed by DB yet)
- Push the resulting file back into the KHTMLPart
Examples
This is what http://www.w3.org/Style/XSL/Overview.xml looks like with XSLT enabled (using the given <?xml-stylesheet?>):

This is what
http://xslt-process.sourceforget.net/docbook-example.xml looks like (using the stylesheet based on the known file-type):
Todo
Unfortunately this is still just a prototype. It has several unresolved issues and is possibly INSECURE:
- Konqueror may crash on closing (it sometimes does for me)
- Level of integration is pretty low. You still see the raw XML content before it switches to the transformed HTML. I still have to figure out if this is suitable as a plugin, if I should create some XML KPart or if this should be integrated into KHTML
- No XInclude support
- Support for more XML schemata
- Possibly vulnerable to XXE (XML eXternal Entity) attacks which basically means a remote XSL could import a file on your harddrive
That said, interested developers can find the current version
here. Please be sure you understand the security risks installing this plugin bears before you proceed!