#876 html: link with xlink:href but no content gives error

output: all formats
closed-fixed
XSL (1066)
5
2007-03-12
2007-02-05
Eelco Dolstra
No

Docbook5-xsl-1.72.0 gives the following error message on <link> elements that have an xlink:href attribute but no content:

Link element has no content and no Endterm. Nothing to show in the link to http://example.org

This did work properly with 1.71.0, and it's allowed according to the DocBook Guide (http://www.docbook.org/tdg5/en/html/link.html):

"When the content of the link element is empty, the content of the xlink:href attribute should be rendered as the text of the link."

Example document:

<book xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">

<title>Test</title>

<chapter>
<title>Test</title>

<para>
Visit <link xlink:href="http://example.org" />.
</para>

</chapter>

</book>

A quick patch that fixed the problem for me is attached. (However, looking at the DocBook 1.71.0 sources, this patch may not be sufficient; 1.71.0 seems to treat links starting with '#' specially.)

Discussion

  • Eelco Dolstra
    Eelco Dolstra
    2007-02-05

    render links with an xlink:href but no content

     
    Attachments
    • summary: link with xlink:href but no content gives error --> html: link with xlink:href but no content gives error
     
  • Robert Stayton
    Robert Stayton
    2007-02-25

    • milestone: 447634 --> output: all formats
    • assigned_to: nobody --> bobstayton
    • status: open --> pending-fixed
     
  • Robert Stayton
    Robert Stayton
    2007-02-25

    Logged In: YES
    user_id=193218
    Originator: NO

    The # bit was a kludge in the db5 fixup code in 1.71 to convert such links to a link element in db4 instead of a ulink element used for other xlink:href values.

     
  • Robert Stayton
    Robert Stayton
    2007-02-25

    Logged In: YES
    user_id=193218
    Originator: NO

    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/

     
  • Logged In: YES
    user_id=578391
    Originator: NO

    Bob, I hit the same bug. I can confirm that the latest snapshot works fine on my test case.

     
  • Logged In: YES
    user_id=1312539
    Originator: NO

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

     
    • status: pending-fixed --> closed-fixed