Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1062 sidebar without title inserts empty b tag

output: HTML
closed-fixed
XSL (1066)
5
2010-09-29
2009-08-20
Robert Nagle
No

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.

Discussion

  • Robert Nagle
    Robert Nagle
    2009-08-20

    index.xml

     
    Attachments
  • Robert Nagle
    Robert Nagle
    2009-08-20

    • milestone: 895397 --> output: HTML
     
  • Robert Nagle
    Robert Nagle
    2009-08-20

    <?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 &mdash;</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>

     
  • Robert Nagle
    Robert Nagle
    2009-08-20

    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.

     
  • Robert Nagle
    Robert Nagle
    2009-08-20

    • assigned_to: abdelazer --> nobody
     
  • Robert Nagle
    Robert Nagle
    2009-08-20

    • assigned_to: nobody --> abdelazer
     
  • Keith Fahlgren
    Keith Fahlgren
    2009-08-20

    • labels: 1168228 --> XSL
     
  • Stuart Rackham
    Stuart Rackham
    2010-08-05

    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>

     
  • Robert Stayton
    Robert Stayton
    2010-08-09

    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/

     
  • Robert Stayton
    Robert Stayton
    2010-08-09

    • assigned_to: abdelazer --> bobstayton
    • status: open --> pending-fixed
     
  • Robert Stayton
    Robert Stayton
    2010-08-09

    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.

     
  • Stuart Rackham
    Stuart Rackham
    2010-08-12

    The fix works with docbook-xsl-snapshot.zip dated 11-Aug-2010 -- thank you.

     
    • status: pending-fixed --> closed-fixed
     
  • 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).