There is a bug in the HTML, XHTML, XHTML 1.1, and (therefore) EPUB stylesheets that outputs an empty <p class="title"> containing a <b> when a DocBook 5.0 (?) sidebar does not have a title.
I've been having issues with epub output of a docbook 5 project. This
problem does NOT occur when I use the HTML chunk XSL transform.
I have 3 questions:
1. why does epub HTML output for sidebar.title include a <b/> tag?
2. why does <b/> in Firefox and IE cause all remaining html
paragraphs to render as bold when a title element in sidebar is empty?
3.is there a docbook way to suppress the display of the
sidebar.title? (I know you could do it in css).
If sidebar.title is to be visible, it would seem odd for the html
output to use <b> (instead of <strong> for example).
I have a test project with xincludes, a customization layer and a
title.xsl generated by titlepage.templates.xml . Below is a version of
it without xincludes to illustrate the problem.
The main index.xml file validates even if I fail to put a title
element inside the sidebar. All text following it in the browser (IE
& firefox) will be bold as a result of the b tags. The same thing
will happen if I include an empty title here. If I include a title tag
with a value, everything will render correctly (although the <b> tag
still appears.
Looking at docbook reference
http://www.docbook.org/tdg5/en/html/sidebar.html , I see that sidebar
requires a title --even though my docbook validated just fine without
one. Strange.
index.xml
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng"
type="xml"?>
<!DOCTYPE book [
<!ENTITY % isopub SYSTEM "http://www.w3.org/2003/entities/iso8879/isopub.ent">
%isopub;
]>
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>Book Project </title>
<author>
<personname>
<firstname>Robert </firstname>
<surname>Nagle</surname>
</personname>
</author>
<volumenum>1234</volumenum>
</info>
<preface label="preface">
<title>Preface Title</title>
<mediaobject>
<imageobject>
<imagedata fileref="myimages/fornarina3.jpg" format="JPG"/>
</imageobject>
</mediaobject>
</preface>
<part label="firststory">
<title> Notions —</title>
<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
xml:id="er1">
<title>First Story</title>
<info>
<annotation role="chaptersummary">
<para>This is a chapter summary </para>
</annotation>
</info>
<epigraph>
<para> This is an epigraph</para>
</epigraph>
<para>This is a test before sidebar. </para>
<sidebar>
<!-- <title>hello</title>-->
<!----------------------------------------------- i'm showing what
happens when title is empty or missing or commented out
----------------------------------------------------------------------------->
<mediaobject>
<imageobject>
<imagedata fileref="myimages/image.jpg" format="JPG"/>
</imageobject>
<textobject>
<phrase>Artist name </phrase>
</textobject>
<caption>
<para> Name of Painting </para>
</caption>
</mediaobject>
</sidebar>
<para>hello One day, <emphasis role="strong">
strong</emphasis>Littering a dark and
dreary road lay the past relics of browser-specific
tags, incompatible DOMs, and
broken CSS support.</para>
</chapter>
</part>
</book>
i'm using a customization layer with the latest version:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import
href="http://docbook.sourceforge.net/release/xsl/1.75.2/epub/docbook.xsl"/>
<xsl:import href="rjtitle.xsl" />
<xsl:param name="epub.oebps.dir">output/OEBPS/</xsl:param>
<xsl:param name="use.id.as.filename">1</xsl:param>
<xsl:param name="html.stylesheet">first.css</xsl:param>
<xsl:param name="show.comments">1</xsl:param>
<xsl:template match="annotation[@role = 'chaptersummary']">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Keith Fahlgren is able to reproduce this. He writes:
"There is a bug in the HTML, XHTML, XHTML 1.1, and (therefore) EPUB
stylesheets that outputs an empty <p class="title"> containing a <b>
when a DocBook 5.0 (?) sidebar does not have a title.
"IE has problems with "self-closing" tags in XHTML. I can't reproduce
the problem with Firefox 3.5.2 on Mac with either xhtml/onechunk.xsl
or html/onechunk.xsl, but I do see it if I unzip the EPUB output.
I get the same problem, but is confined to EPUB outputs (not XHTML)
and results in the sidebar and all subsequent text on the page
displayed in bold text in both Firefox 3.6.8 and Google Chrome
5.0.375.125 (I haven't checked other browsers).
Environment: DocBook XSL 1.75.2; Xubuntu 10.04
If a DocBook sidebar element does not have a title then the emitted
title is (I haven't checked other browsers).
set to <b/> instead of <b></b>, for example this DocBook markup:
<sidebar>
<simpara>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</simpara>
</sidebar>
Generates this EPUB XHTML:
<div class="sidebar"><p class="title"><b/></p><p>Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.</p></div>
This problem is not picked up by either the epubcheck or the W3C
validators.
The problem does not occur generating XHTML which emits the following
for the above example:
<div class="sidebar"><p class="title"><b></b></p><p>Lorem ipsum
dolor sit amet, consectetuer adipiscing elit.</p></div>
A fix for this issue has been added to the current codebase.
Please test the fix with the latest snapshot from:
http://docbook.sourceforge.net/snapshots/
I changed the handling of sidebar title to use the titlepage.templates.xml system like the FO side, so that if the title does not exist then it does not generate an empty title in the HTML.
The fix works with docbook-xsl-snapshot.zip dated 11-Aug-2010 -- thank you.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).