Hi Kevin,
Currently there are no parameters that fix the two problems you mention.
In XHTML 1.0, either lang or xml:lang is permitted. In XHTML 1.1, only
xml:lang is permitted. You can copy the template named
'language.attribute' from common/l10n.xsl to your customization layer and
change this line:
<xsl:attribute name="lang">
to
<xsl:attribute name="xml:lang">
For the width attribute in the admonition td, you'll have to copy the
template named 'graphical.admonition' from xhtml/admon.xsl to your
customization layer and remove the width attribute.
I think setting a parameter for XHTML 1.1 might be a good thing, and would
make a fine feature request. But feature requests made on this mailing
list get forgotten, so I would suggest you request it in the SourceForge
project for DocBook. Select Submit New on this page:
http://sourceforge.net/tracker/?group_id=21935&atid=373750
Bob Stayton
Sagehill Enterprises
DocBook Consulting
----- Original Message -----
From: "Kevin Ruscoe" <>
To: <>
Sent: Tuesday, December 19, 2006 10:01 PM
Subject: [docbook-apps] [QUESTION] Generating XHTML 1.1 from docbook-xsl
> Hi all
>
> I am attempting to produce XHTML 1.1 output from my DocBook source.
> Having followed the guidelines at the following link:
>
> http://www.sagehill.net/docbookxsl/OtherOutputForms.html#StrictXhtmlValid
>
> I only have two errors left. Specifically, given the following files...
>
> ==============================================================================
> test.dbk
> --------
> <?xml version='1.0'?>
> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
>
> "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
>
> <article>
> <para>
> <important>
> <para>
> test
> </para>
> </important>
> </para>
> </article>
> ==============================================================================
> test.xsl
> --------
> <?xml version='1.0'?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version='1.0' xmlns="http://www.w3.org/TR/xhtml">
> <xsl:import
> href="/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl"/>
>
> <!-- PARAMETERS -->
>
> <!-- Admonitions -->
> <xsl:param name="admon.graphics">1</xsl:param>
>
> <!-- HTML -->
> <xsl:param name="css.decoration">0</xsl:param>
> <xsl:param name="html.longdesc">0</xsl:param>
> <xsl:param name="make.valid.html">1</xsl:param>
> <xsl:param name="html.cleanup">1</xsl:param>
>
> <!-- Linking -->
> <xsl:param name="ulink.target"></xsl:param>
>
> <!-- Graphics -->
> <xsl:param name="use.viewport">0</xsl:param>
>
>
> <!-- OUTPUT -->
>
> <xsl:output method="xml"
> encoding="UTF-8"
> indent="yes"
> doctype-public="-//W3C//DTD XHTML 1.1//EN"
> doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
> </xsl:stylesheet>
> ==============================================================================
> test.sh
> -------
> #!/bin/sh
>
> xsltproc -o test.xhtml test.xsl test.dbk
> ==============================================================================
>
> ...running test.sh produces the following output
> (I have adjusted white space for readability):
>
> ==============================================================================
> test.xhtml
> ----------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title></title>
> <meta name="generator" content="DocBook XSL Stylesheets V1.68.1"/>
> </head>
> <body>
> <div class="article" lang="en">
> <div class="titlepage">
> <hr/>
> </div>
> <p>
> </p>
> <div class="important" style="margin-left: 0.5in; margin-right:
> 0.5in;">
> <table border="0" summary="Important">
> <tr>
> <td rowspan="2" align="center" valign="top" width="25">
> <img alt="[Important]" src="images/important.png"/>
> </td>
> <th align="left">Important</th>
> </tr>
> <tr>
> <td align="left" valign="top">
> <p>
> test
> </p>
> </td>
> </tr>
> </table>
> </div>
> <p>
> </p>
> </div>
> </body>
> </html>
> ==============================================================================
>
> Validating this against XHTML 1.1 gives the following errors:
>
> ==============================================================================
> Error /Line 9 column 30/: there is no attribute "lang".
> | <div class="article" lang=*"*en">|
>
> Error /Line 18 column 62/: there is no attribute "width".
> |... <td rowspan="2" align="center" valign="top" width=*"*25">|
> ==============================================================================
>
> My questions are these:
>
> * Is there a way to eliminate these errors while keeping the XHTML output
> unchanged? (For example, I know that I could cut out the second error by
> disabling graphical admonitions.)
>
> * If not, could I submit a feature request that a future release of the
> stylesheets provide a means of avoiding these errors?
>
> NB The documentation for the stylesheets states:
>
> "There is no option or parameter for turning on Strict XHTML processing."
>
> and I understand this. I am quite happy to comply with a series of
> restrictions, of the sort given at:
>
> http://www.sagehill.net/docbookxsl/OtherOutputForms.html#StrictXhtmlValid
>
> My toolchain is as follows:
>
> ==============================================================================
> DocBook v4.4
>
> $ xsltproc --version
> Using libxml 20626, libxslt 10117 and libexslt 813
> xsltproc was compiled against libxml 20626, libxslt 10117 and libexslt
> 813
> libxslt 10117 was compiled against libxml 20626
> libexslt 813 was compiled against libxml 20626
>
> docbook-xsl v1.71.1
> ==============================================================================
>
> Regards
> Kevin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
>
>
>