epub transform bug? sidebar without title bolds everything? (bad rendering in Firefox?)

View: New views
2 Messages — Rating Filter:   Alert me  

epub transform bug? sidebar without title bolds everything? (bad rendering in Firefox?)

by Robert Nagle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 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.

Anyone know what's up?

Thanks.

rj



HTML Output from epub docbook.xsl  looks like this:

           <div class="epigraph"><p> This is an epigraph</p></div>
           <p>This is a test before sidebar. </p>
 <!----------------------------------- an empty title element inside
sidebar  the random </b> tag below  screws up the rendering in the
browser!!!!!!!!
------------------------------------------------------------------------->
           <div class="sidebar"><p class="title"><b/></p>

               <div class="mediaobject"><img src="myimages/image.jpg"
alt="Artist name"/><div class="caption">
                       <p>  Name of Painting </p>
                   </div></div>
           </div>
           <p>hello One day, <span class="strong"><strong>
strong</strong></span>Littering a dark and
               dreary road lay the past relics of browser-specific
tags, incompatible DOMs, and
               broken CSS support.</p>

here is the source 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>




--
Robert Nagle
http://www.imaginaryplanet.net/weblogs/idiotprogrammer/

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: epub transform bug? sidebar without title bolds everything? (bad rendering in Firefox?)

by Keith Fahlgren-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Aug 19, 2009 at 1:38 AM, Robert Nagle<idiotprogrammer@...> wrote:
>  I've been having issues with epub output of a docbook 5 project.

I am able to reproduce what you describe below.

> This
> problem does NOT occur when I use the HTML chunk XSL transform.

I disagree. The HTML output is (onechunk):

    <p>This is a test before sidebar. </p>
    <div class="sidebar"><p class="title"><b></b></p>


> I have 3 questions:
>
>  1. why does epub HTML  output for sidebar.title include a <b/> tag?

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. Please create a
new bug: http://sourceforge.net/tracker/?group_id=21935&atid=373747

>  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?

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.

>  3.is there a docbook way to suppress the display of the
> sidebar.title? (I know you could do it in css).

No, I think we just fix the stylesheets.

In the mean time, you could customize the xhtml-1_1/block.xsl template
for "abstract|sidebar" to make sure it checks for the title before
calling formal.object.heading.

> If sidebar.title is to be visible, it would seem odd for the html
> output to use <b> (instead of <strong> for example).

There's a lot of in the DocBook (X)HTML output that isn't as semantic
as it could be.

> Below is a version of
> it without xincludes to illustrate the problem.

Thank you for including a sample. This helps tremendously in locating
the problem.

> 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.

I don't think that's true. I think the title is optional for a sidebar.



Keith

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...