docbook-apps

Re: [docbook-apps] Don't know what gentext to create for xref to "informalfigure" or "mediaobject"

  • 1.  Re: [docbook-apps] Don't know what gentext to create for xref to "informalfigure" or "mediaobject"

    Posted 03-16-2009 16:22
    Hi,
    The stylesheets currently don't have a method of generating text for an xref
    to a mediaobject. While it might seem obvious to use the caption text, that
    is not always appropriate. I've seen captions with multiple paras and an
    equation or two, and all that text is not appropriate for an xref link. The
    same problem applies to an xref to any element that can contain a mix of
    block elements. Even a para can contain other block elements.

    One solution is to put the mediaobject inside a figure element, move the
    caption text to the figure title, and xref to the figure. But figure titles
    are numbered, and you may not want that.

    Another solution is to put an id attribute on the para inside the caption,
    and add an endterm attribute to the xref that points to that id:

    <para id="ghist">Graphical history of the <filename
    class="directory">hello</filename> repository</para>

    <xref endterm="ghist" linkend="fig.tour-basic.history"/>

    See this reference for more information on the use of endterm:

    http://www.sagehill.net/docbookxsl/CrossRefs.html#OptsGenXref

    You could also develop a customization that uses the caption for the
    generated text for an xref to a mediaobject.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net