Need to do a "book style" Table of Contents

Discussion in 'XML' started by wardellcastles, Jun 25, 2005.

  1. 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?
     
    wardellcastles, Jun 25, 2005
    #1
    1. Advertising

  2. wardellcastles

    Andy Dingley Guest

    On 24 Jun 2005 21:42:10 -0700, "wardellcastles"
    <> wrote:

    >Does anyone have any suggestions?


    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.
     
    Andy Dingley, Jun 25, 2005
    #2
    1. Advertising

  3. 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
     
    wardellcastles, Jun 25, 2005
    #3
  4. wardellcastles

    HALLES Guest

    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)
     
    HALLES, Jun 25, 2005
    #4
  5. In message <>,
    wardellcastles <> writes
    >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.


    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, Jun 27, 2005
    #5
  6. wardellcastles

    Peter Flynn Guest

    wardellcastles wrote:

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


    Transform to LaTeX and let it do it.

    ///Peter
    --
    sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
    &;top"
     
    Peter Flynn, Jun 27, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Williams
    Replies:
    2
    Views:
    1,140
    Jacob Yang [MSFT]
    Aug 12, 2003
  2. Rio
    Replies:
    4
    Views:
    1,203
  3. Don Adams
    Replies:
    1
    Views:
    604
    Martin Honnen
    Mar 5, 2004
  4. Kamarulnizam Rahim
    Replies:
    4
    Views:
    224
    Robert Klemme
    Jan 28, 2011
  5. Replies:
    0
    Views:
    197
Loading...

Share This Page