From: SourceForge.net <no...@so...> - 2011-01-05 22:11:13
|
Bugs item #3083800, was opened at 2010-10-08 10:09 Message generated for change (Comment added) made by idiotprogrammer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373747&aid=3083800&group_id=21935 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: XSL Group: output: HTML Status: Open Resolution: None Priority: 5 Private: No Submitted By: Robert Nagle (idiotprogrammer) Assigned to: Keith Fahlgren (abdelazer) Summary: extra <div class="titlepage> and <div class="title"> Initial Comment: Hi, I'm running the normal docbook xsl and using docbook-xsl-1.76.1-RC1/epub/docbook.xsl"/> I've noticed extra div tags popping up which ruin the styles..You can see this in action in the OEBPS/ch02.html file INPUT: <sidebar> <para> first sentence of sidebar </para> <para>second sentence of sidebar</para> </sidebar> <para>In the current hydrocarbon economy, transportation is fueled primarily by petroleum. Burning of hydrocarbon fuels emits carbon dioxide and other pollutants. The supply of economically usable hydrocarbon resources in the world is limited, and the demand for hydrocarbon fuels is increasing, particularly in China, India and other developing countries.</para> OUTPUT: <div class="sidebar"><div class="titlepage"/> <p> first sentence of sidebar </p> <p>second sentence of sidebar</p> </div> <p>In the current hydrocarbon economy, transportation is fueled primarily by petroleum. Burning of hydrocarbon fuels emits carbon dioxide and other pollutants. The supply of economically usable hydrocarbon resources in the world is limited, and the demand for hydrocarbon fuels is increasing, particularly in China, India and other developing countries.</p> I also see at the top of the document: <body><div class="chapter" title="Chapter 2. second test"><div class="titlepage"><div><div><h1 class="title"><a id="test2"/>Chapter 2. second test </h1></div></div></div> I'm not sure why the Firefox/Chrome browsers do this, but the extra div tags in sidebar causes the browsers to use the style from div.class="sidebar" even after the div tag is closed. ---------------------------------------------------------------------- Comment By: Robert Nagle (idiotprogrammer) Date: 2011-01-05 16:11 Message: Update: This problem is the result of <div class="titlepage"/> being an empty tag; it reliably messes up browsers. One workaround for XHTML output is to use this parameter: <xsl:param name="chunker.output.method">saxon:xhtml</xsl:param> However, I don't use saxon when running db2epub.py (it uses lxml), so this statement wouldn't do anything. ---------------------------------------------------------------------- Comment By: Robert Nagle (idiotprogrammer) Date: 2010-10-13 20:03 Message: If I do not include a <title> element inside sidebar, I would not expect <p class="title"> or <p class="titlepage"> to be anywhere; it should simply be a <p>. In the web browser, the presence of that empty div causes the style of the div.sidebar to continue beyond the ending of the sidebar.div tag. So in my test project with my css, the rest of the text after the sidebar is automatically given an olive color. If a nonexistent title element caused this to be spit out: <div class="sidebar"><p class="title"><b></b></p>, that would not break the css. But if it spits out <div class="sidebar"><div class="titlepage"></div>, then the css will break. Personally I have no idea why an empty div tag would disrupt the css so much. it makes no sense. My first guess is that it's a browser bug, but Firefox/IE/Chrome all show the same strangeness. Please note that if I include a <title> element here with a value,the CSS renders everything fine. The rule should be: if no title is included inside a sidebar, then the div that would normally appear containing the title value should be omitted altogether. ---------------------------------------------------------------------- Comment By: Keith Fahlgren (abdelazer) Date: 2010-10-13 15:04 Message: This is an (X)HTML issue rather than just an EPUB one. 1.75.2 outputs <div class="sidebar"><p class="title"><b></b></p> 1.76.1-RC1 outputs <div class="sidebar"><div class="titlepage"></div> What do you think should be outputted? ---------------------------------------------------------------------- Comment By: Robert Nagle (idiotprogrammer) Date: 2010-10-08 13:54 Message: One more thing. I wish to state why this bug is bothersome. Inserting that extra bug causes (in Firefox and Chrome at least) the css for div.sidebar to be applied to the remainder of the document, so it breaks the css...... You can verify this by looking at the OEPBS/ch02.html file. This seems to be related to the https://sourceforge.net/tracker/?func=detail&aid=3014425&group_id=21935&atid=373747 bug. ---------------------------------------------------------------------- Comment By: Robert Nagle (idiotprogrammer) Date: 2010-10-08 10:15 Message: sorry, the zip file didn't contain the customization layer. I added it as a second attachment. testepub.xsl ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373747&aid=3083800&group_id=21935 |