Re: [xep-support] creating "live" links in PDF output, starting from the <link> tag in XML

From: G. Ken Holman (
Date: Thu Aug 28 2003 - 11:55:49 PDT

  • Next message: Louis Meigret: "RE: [xep-support] Can Renderx be used within an EJB ?"

    At 2003-08-28 12:59 -0400, Susan Korgen wrote:
    >My XML documents use a lot of internal cross-references.
    >So far I cannot get these links to work in PDF.
    >I need to know:
    >What syntax do I use in my XSL file,
    >so that when I run XEP with this XSL file as input,
    >XEP can process the <link> tags in my XML file
    >to generate a working link in my output PDF file?
    >Here are some more details:
    >By "working link" I mean the reader can click on
    >the text while viewing it in in Acrobat, and Acrobat
    >will then "jump" to that section of the PDF file.

    If you download the free excerpt of our XSL-FO book from our web site cited
    below, this excerpt was produced using XEP and contains a tremendous number
    of local hyperlinks, mostly in the back-of-the-book index, but also
    throughout the text.

    >The links I need have various targets. Some are defined
    >as <sect1>, others <sect2>, or <sect3>, or <sect4>.

    One of the XSL-FO objects you produce for each of these will need a unique
    identifier. The production of areas from these objects will place these
    unique identifiers in the area tree. An XSL-FO processor links to target
    ids in the area tree (not to target ids in the formatting object tree).

    >Each of these sections has an identifier defined in its
    >attributes, and each identifier is unique across the entire
    >book, regardless of which type of section tag is used.

    Good! Then use that identifier in your formatting object that produces
    areas in your area tree. I find when aggregating XML instances that I
    cannot use the naked identifier, that I have to use generate-id() to ensure
    uniqueness, but from what you say this is not the case for you.

    Where you make the reference, use the <basic-link> construct with the
    internal-destination= property being the identifier to which you want the
    user to jump. Then, the areas created by your <basic-link> become the
    "hot" areas for operator interaction: where they click.

    >If it is helpful, below please find two kinds of XML excerpts:
    >- the typical XML syntax that I use for <link> tags

    You will use <basic-link> with internal-destination= the @linkend attribute.

    >- a typical "target" of such a link in XML, one of the 5 types listed above
    >I have arranged excerpts in pairs to give you an idea of how
    >the <link> tags and their targets are supposed to "match up."

    You will use <block> or <inline> or whatever you need for that construct,
    with the id= being the @id value.

    ><link linkend="EGMG_ensemble_management_portal">Ensemble Management
    ><chapter id="EGMG_ensemble_management_portal"> ... </chapter>

    This is what I do for *all* my internal links in my book
    excerpt. Actually, you will find at the bottom of every page except the
    title page 28 internal hyperlinks for access to the table of contents and
    portions of the index. Also, we have hyperlinked the section numbers of
    the XSL-FO specification out to the web document at the W3C by using
    external-destination= ... this allows readers to use our books to jump
    around the W3C document. Try it out from any of the section numbers listed
    in the property section.

    I hope this helps.

    ................. Ken

    Next public European delivery:  3-day XSLT/2-day XSL-FO 2003-09-22
    Instructor-led on-site corporate, government & user group training
    for XSLT and XSL-FO world-wide:  please contact us for the details
    G. Ken Holman       
    Crane Softwrights Ltd.
    Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
    ISBN 0-13-065196-6                       Definitive XSLT and XPath
    ISBN 0-13-140374-5                               Definitive XSL-FO
    ISBN 1-894049-08-X   Practical Transformation Using XSLT and XPath
    ISBN 1-894049-11-X               Practical Formatting Using XSL-FO
    Member of the XML Guild of Practitioners:
    Male Breast Cancer Awareness
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service

    This archive was generated by hypermail 2.1.5 : Thu Aug 28 2003 - 11:58:50 PDT