Loading ...
Sorry, an error occurred while loading the content.

How to build a table of content ?

Expand Messages
  • volkerkugler
    Hello, i must make a PDF-File with XSL:FO from a XML-File. This XML-File only contents the data for the PDF-File, without IDs or another informations. I search
    Message 1 of 2 , Mar 12, 2003
    • 0 Attachment
      Hello,

      i must make a PDF-File with XSL:FO from a XML-File.

      This XML-File only contents the data for the PDF-File, without IDs or
      another informations.

      I search the web for a few days to get some examples for making a
      table of content. But i didn't find a real example.

      So my question was, how to make this. Do i need to transform the XML
      to another XML including IDs ? Because i found no other way to get a
      reference to a page number or a chapter text.

      If anybody could send me a link to a example or the example itself i
      will be thankful.

      Thanks

      Volker
    • G. Ken Holman
      Co-incidentally, something very similar was asked today on the W3C XSL-FO list regarding tables of content and hyperlinks into the body of the work, here is my
      Message 2 of 2 , Mar 12, 2003
      • 0 Attachment
        Co-incidentally, something very similar was asked today on the W3C XSL-FO
        list regarding tables of content and hyperlinks into the body of the work,
        here is my response:

        http://lists.w3.org/Archives/Public/www-xsl-fo/2003Mar/0020.html

        With the follow up repair of my example ... I should have said
        internal-destination="{generate-id(.)}" as ref-id= is used for page numbers.

        At 2003-03-12 19:27 +0000, volkerkugler wrote:
        >This XML-File only contents the data for the PDF-File, without IDs or
        >another informations.
        >...
        >So my question was, how to make this.

        In one pass, using the generate-id() function.

        The linked example above is for hyperlinks from the table of contents, but
        the same principle applies for page number citations:

        (1) - in your table of contents, when your current node is a chapter
        node, cite the page of the chapter with:

        <page-number-citation ref-id="{generate-id(.)}"/>

        (2) - at the beginning of your chapter create an anchor for your citation:

        <block id="{generate-id(.)}"/>

        Since the same node is the current node for both of the above statements,
        the same value is returned for the generate-id(.) function. This value is
        required to match an XML name pattern, thus allowing the value to be used
        as anchors.

        I hope this helps.

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


        --
        Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO
        North America: June 16-20, 2003

        G. Ken Holman mailto:gkholman@...
        Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
        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-10-1 Practical Formatting Using XSL-FO
        Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
      Your message has been successfully submitted and would be delivered to recipients shortly.