Need to do a "book style" Table of Contents

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wardellcastles

    Need to do a "book style" Table of Contents

    I need to transform from an xml specification to a document with a
    "book-style" table of contents; one with page numbers, not html
    hyperlinks (The output of the XSLT is NOT html).

    For example, here's an example of the desired output.

    Title Page
    .......
    End of Page 1

    Table Of Contents

    I. Chapter 1...... Page 3
    II. Chapter 2..... Page 5
    III. Chapter 3.... Page 10

    End of Page 2

    Chapter 1
    ...2 pages..

    Chapter 2
    ... 5 pages..

    Chapter 3
    ...1 to many pages ..

    I think I might be able to calculate the page numbers for the different
    chapters using <msmxl:script language ...>

    My challenge is that I want to calculate the pages so that I can print
    the Table of Contents BEFORE I actually output Chapter 1, 2, 3.

    One way I thought I could do this is via a 2 step transformation. The
    first would have the output file with the TOC at the end after the
    chapter page numbers are calculated, then transform again to put the
    TOC at the desired location within the final document. However I
    really want to do it in one transformation.

    Does anyone have any suggestions?

  • Andy Dingley

    #2
    Re: Need to do a &quot;book style&quot; Table of Contents

    On 24 Jun 2005 21:42:10 -0700, "wardellcastles "
    <wardellcastles @hotmail.com> wrote:
    [color=blue]
    >Does anyone have any suggestions?[/color]

    No. Page numbers are tricky, because there aren't any "pages" in a
    document that's just a flow of objects. You can only start to identify
    (and thus number) pages when you get quite close to the final output
    processes - and that depends on what your output mechanism is, which you
    haven't told us about.

    So, it's probably ugly, it's probably multi-pass, it probbly involves
    scripting, but we can't be any more specific than that/

    Incidentally, it's worth reading through old (I mean _old_) textbooks
    like Knuth or Kernighan & Plauger's "Software Tools In <foo>" to read of
    the old dinosaur era when we had to write our own pagination algorithms
    from carved sticks and wet string. Some of that stuff is still
    applicable, even today.

    Comment

    • wardellcastles

      #3
      Re: Need to do a &quot;book style&quot; Table of Contents

      Just to clarify with everyone, at least in my specific application, the
      determination of the page numbers for Chapter 1, 2, 3, etc is not my
      primary concern.

      The real problem is how to gather the info for the table of contents
      page so that it can be printed before the chapters are printed so that
      it can be done in one transformation.

      Thanks!
      Wardell

      Comment

      • HALLES

        #4
        Re: Need to do a &quot;book style&quot; Table of Contents

        Hello i have the same goal as you it seems.

        Use XML and other X... files to gather and display structured infos !

        It is a paradox !
        A clear aim, and no one to help !

        It is all OUR fault, yes, we see structured algorithms in XML and X..
        files, it is not yet the case !

        HALLES. french paradoxal thinker ;o)

        Comment

        • Richard Light

          #5
          Re: Need to do a &quot;book style&quot; Table of Contents

          In message <1119706144.680 982.235340@g44g 2000cwa.googleg roups.com>,
          wardellcastles <wardellcastles @hotmail.com> writes[color=blue]
          >Just to clarify with everyone, at least in my specific application, the
          >determinatio n of the page numbers for Chapter 1, 2, 3, etc is not my
          >primary concern.
          >
          >The real problem is how to gather the info for the table of contents
          >page so that it can be printed before the chapters are printed so that
          >it can be done in one transformation.[/color]

          As Andy says, you haven't told us what environment you _are_ trying to
          generate this output in. If you use the framework which was designed to
          produce paginated output from XML sources, i.e. XSL-FO, this capability
          is built-in so the job becomes easy.

          Richard

          --
          Richard Light
          SGML/XML and Museum Information Consultancy
          richard@light.d emon.co.uk

          Comment

          • Peter Flynn

            #6
            Re: Need to do a &quot;book style&quot; Table of Contents

            wardellcastles wrote:
            [color=blue]
            > I need to transform from an xml specification to a document with a
            > "book-style" table of contents; one with page numbers, not html
            > hyperlinks (The output of the XSLT is NOT html).[/color]

            Transform to LaTeX and let it do it.

            ///Peter
            --
            sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
            &;top"

            Comment

            Working...