Bugs item #1449319, was opened at 03/13/06 18:42
Message generated for change (Comment added) made by sf-robot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=373747&aid=1449319&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: Closed
Resolution: Fixed
Priority: 5
Submitted By: Ian Barnes (ian_barnes)
Assigned to: Robert Stayton (bobstayton)
Summary: Wrong levels for bridgeheads in XHTML
Initial Comment:
In XHTML output, bridgeheads come out too large. I
checked the generated XHTML code, and sure enough,
<bridgehead renderas="sect1">
gets rendered as <h1>, while <sect1><title> gets
rendered as <h2>.
In xhtml/sections.xsl I found the following code.
<!-- HTML H level is one higher than section level -->
<xsl:variable name="hlevel">
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">1</xsl:when>
<xsl:when test="@renderas = 'sect2'">2</xsl:when>
<xsl:when test="@renderas = 'sect3'">3</xsl:when>
<xsl:when test="@renderas = 'sect4'">4</xsl:when>
<xsl:when test="@renderas = 'sect5'">5</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$clevel + 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Looks to me like the comment is correct but the code is
wrong. Should read:
<!-- HTML H level is one higher than section level -->
<xsl:variable name="hlevel">
<xsl:choose>
<xsl:when test="@renderas = 'sect1'">2</xsl:when>
<xsl:when test="@renderas = 'sect2'">3</xsl:when>
<xsl:when test="@renderas = 'sect3'">4</xsl:when>
<xsl:when test="@renderas = 'sect4'">5</xsl:when>
<xsl:when test="@renderas = 'sect5'">6</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$clevel + 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
I haven't checked whether the same error exists in
plain HTML. A quick look at PDF output generated by the
FO stylesheets & FOP suggests that the FO stylesheets
might be OK.
----------------------------------------------------------------------
>Comment By: SourceForge Robot (sf-robot)
Date: 05/14/06 19:20
Message:
Logged In: YES
user_id=1312539
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).
----------------------------------------------------------------------
Comment By: Robert Stayton (bobstayton)
Date: 04/30/06 02:04
Message:
Logged In: YES
user_id=193218
Yes, it was wrong. In section title processing, the
section level is passed to the section.heading template
which bumps up the H level. In bridgehead, the
section.heading template is not called, so it should bump
it up directly.
----------------------------------------------------------------------
Comment By: Robert Stayton (bobstayton)
Date: 04/30/06 02:04
Message:
Logged In: YES
user_id=193218
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/
----------------------------------------------------------------------
Comment By: Michael(tm) Smith (xmldoc)
Date: 04/06/06 18:08
Message:
Logged In: YES
user_id=118135
Bob,
I looked at this but not sure what to do. So, I'm taking
the liberty of re-assigning it to you because it relates
to a change you made some time back. Please see the
dialogs.
--mike
----------------------------------------------------------------------
Comment By: Michael(tm) Smith (xmldoc)
Date: 04/06/06 07:52
Message:
Logged In: YES
user_id=118135
Ian,
Yeah, an example would be great. Please attach/upload it
here. But ultimately, I think I need to ask Bob to look
at this. He's the one who made the change, so hopefully
he still remembers the rationale behind it.
----------------------------------------------------------------------
Comment By: Ian Barnes (ian_barnes)
Date: 04/06/06 06:55
Message:
Logged In: YES
user_id=1475446
I do think it's plain wrong. I thought the whole idea of a bridgehead was to look
like a section heading. So <bridgehead renderas="sect1"> should be formatted
the same as <sect1><title>. In XHTML, that means they should both become
<h2>. If you like, I'll cook up an example file so you can see what I mean.
----------------------------------------------------------------------
Comment By: Michael(tm) Smith (xmldoc)
Date: 04/05/06 03:29
Message:
Logged In: YES
user_id=118135
Actually, it looks like the comment is out of date.
<xsl:when test="@renderas = 'sect1'">2</xsl:when> etc.
is the way it was originally in the code. Bob explicitly
changed it to the way it is now about three years ago.
So it is that way be design. If you think it is plain
wrong to have it that way, please reply and I will try
to discuss with Bob and find out that rationale.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=373747&aid=1449319&group_id=21935
|