Bugs item #1741799, was opened at 2007-06-23 02:54
Message generated for change (Comment added) made by xmldoc
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=373747&aid=1741799&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: print/FO/PDF
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Onkar Shinde (onkarshinde)
Assigned to: Nobody/Anonymous (nobody)
Summary: Two links are generated when url is not same as label
Initial Comment:
I am using docbook-xsl 0.72 along with FOP to generate PDF from docbook xml.
Problem is that whenever I want to create a link using <ulink> tag, it generates two links when url label is not same as url itself.
ex. <ulink type="help" url="http://www.gnu.org/licenses/fdl.html">FDL</ulink>
generates
FDL [http://www.gnu.org/licenses/fdl.html]
in PDF where FDL itself is a also hyperlink.
This problem is not observed in HTML XSL, but only in FO XSL.
I think this part of xref.xsl is problematic.
<xsl:template match="ulink" name="ulink">
<xsl:param name="url" select="@url"/>
<xsl:variable name="link">
<a>
<xsl:if test="@id or @xml:id">
<xsl:attribute name="name">
<xsl:value-of select="(@id|@xml:id)[1]"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute>
<xsl:if test="$ulink.target != ''">
<xsl:attribute name="target">
<xsl:value-of select="$ulink.target"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="$url"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:variable>
----------------------------------------------------------------------
>Comment By: Michael(tm) Smith (xmldoc)
Date: 2007-07-04 06:46
Message:
Logged In: YES
user_id=118135
Originator: NO
> Sender: mzjn
>
> Would you consider the problem solved if the default value for
ulink.show
> was changed to 0?
In general, changing the default value of an existing parameter is not an
option.
> Sender: onkarshinde
>
> I am sorry if I am unable to make myself clear. What I want is that
when
> ulink.show is 1, the output should be same in HTML and FO. But this is
not
> the case currently. So according to me the problem is in one of the
XSL.
Can you please describe exactly what you mean when you say that the
output
should be the same? The purpose of ulink.show is to display the URL
inline
so that when you print out a hard copy of the document, the link info
is preserved. There is no ulink.show option for HTML output, and no
mechanism in the stylesheets for making link URLs appear inline. Is your
suggestion that we should support ulink.show in HTML?
> Sender: onkarshinde
>
> I am assuming that the value of ulink.show is 1 by default, because I
> didn't specify it.
Yes, it is on by default.
> But in that case I think that the output should be similar in HTML and
FO.
> Is there any particular reason this is not the case?
The reason is that when you are viewing an HTML page, you are viewing it
in a browser which shows the hyperlinks in a way that makes them
discoverable (highlighted+underlined, plus a cursor change when you
hover over them) and that lets you activate and follow the hyperlinks
by clicking on them. So you don't need to see the URLs -- only your
browser needs to know what they are.
But in FO output, the destination isa document that may possibly be
printed out as a hard copy, not just viewed online. So the URLs for
the links need to be displayed somewhere in the document, either
inline (as they are when ulink.show is non-zero) or as footnotes
(which is what you get if ulink.footnotes is non-zero).
----------------------------------------------------------------------
Comment By: Onkar Shinde (onkarshinde)
Date: 2007-07-04 03:47
Message:
Logged In: YES
user_id=574312
Originator: YES
I am sorry if I am unable to make myself clear. What I want is that when
ulink.show is 1, the output should be same in HTML and FO. But this is not
the case currently. So according to me the problem is in one of the XSL.
----------------------------------------------------------------------
Comment By: Mauritz Jeanson (mzjn)
Date: 2007-07-04 03:38
Message:
Logged In: YES
user_id=582041
Originator: NO
Would you consider the problem solved if the default value for ulink.show
was changed to 0?
----------------------------------------------------------------------
Comment By: Onkar Shinde (onkarshinde)
Date: 2007-07-04 03:12
Message:
Logged In: YES
user_id=574312
Originator: YES
All I am saying is that behavior should be consistent in HTML as well as
FO output. If you really think that 'behavior not being consistent' 'is not
a bug' then close it the way it pleases you.
----------------------------------------------------------------------
Comment By: Mauritz Jeanson (mzjn)
Date: 2007-07-04 00:26
Message:
Logged In: YES
user_id=582041
Originator: NO
Yes, the ulink.show parameter = 1 by default. I suppose Norman Walsh
considered this to be a reasonable choice when he added it in 2002. Setting
the parameter to 0 will suppress the URL.
----------------------------------------------------------------------
Comment By: Onkar Shinde (onkarshinde)
Date: 2007-07-03 16:05
Message:
Logged In: YES
user_id=574312
Originator: YES
I am assuming that the value of ulink.show is 1 by default, because I
didn't specify it.
But in that case I think that the output should be similar in HTML and FO.
Is there any particular reason this is not the case?
----------------------------------------------------------------------
Comment By: Mauritz Jeanson (mzjn)
Date: 2007-07-02 02:11
Message:
Logged In: YES
user_id=582041
Originator: NO
If ulink.show=1, both the link text and the URL are shown (if they are not
the same), and both are clickable hyperlinks. Why is this a problem?
If you want only the URL to be a hyperlink when ulink.show=1, then you can
file a feature request for that. But I would not consider the current
behaviour to be a bug.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=373747&aid=1741799&group_id=21935
|