Re: [xep-support] Creating a Table of Contents from an HTML file being transformed using XSL to FO

From: Werner Donné (werner.donne@re.be)
Date: Wed Sep 29 2004 - 14:12:33 PDT

  • Next message: Nicholas Gledhill: "RE: [xep-support] initial page number"

    Kenneth,

    Unfortunately the style sheet I have sent only transforms XHTML into
    XHTML. It just adds a few things to it. Producing XSL-FO with an XSLT
    style sheet is possible but complex. You can find an example at
    http://www.antennahouse.com/XSLsample/XSLsample.htm.

    The disadvantage of this approach, however, is that you have to choose
    a particular style for your XHTML documents. Starting from an existing
    set of XSLT files, it is not easy to do customisations. That is because
    XSLT is not very suitable for a kind of library approach. You can't
    easily say, for example, "do what you normally do and this little bit
    different", without knowlegde of the style sheets you are customising.

    Freedom of style is given to XHTML through CSS, which is very customisable
    because of its cascading mechanism. It is also less powerful in addressing
    parts of your input document, as well as in producing a formatted result.
    You can obtain XSL-FO, however, by using CSSToXSLFO. It can convert an
    XHTML document with a CSS style sheet into XSL-FO. Since you are an XEP
    user, you can use the alternative packaging of CSSToXSLFO that feeds
    the XSL-FO straight into XEP, giving you a XHTML/CSS to PDF or PostScript
    converter. We do this in our project for reports up to 2000 pages. The
    solution is quite performant, if you give it enough memory, which is not
    a problem on a big server.

    Note the disadvantage that you don't have the fine-grained control over
    formatting as you would have when producing XSL-FO directly. You are
    limited by what CSS can express. The advantage though is that you have
    a much simpler way to generate plenty of XSL-FO.

    Regards,

    Werner.

    Kenneth Aitken wrote:
    > Hi Werner
    >
    > Thank you very much for replying so promptly. I would really appreciate it if you could also give me a hint as to how to adapt it for transforming XHTML directly to FO.
    > Could you indicate the relevant parts in the file to me, for example? That would be very helpful.
    >
    > Thanks again.
    >
    > Kenneth
    >
    > *********** REPLY SEPARATOR ***********
    >
    > On 29.09.2004 at 10:38 Werner Donné wrote:
    >
    >
    >>Kenneth,
    >>
    >>This is what I use. Note that the actual TOC-lines that are generated
    >>are meant for processing with CSSToXSLFO, but you can easily replace it
    >>with whatever you want.
    >>
    >>Regards,
    >>
    >>Werner.
    >>
    >>Kenneth Aitken wrote:
    >>
    >>>Has anyone successfully created a Table of Contents (TOC) using XSLT to
    >>
    >>transform HTML files to FO files (and, ultimately, to PDF, e.g. with XEP),
    >>with the HTML structure:
    >>
    >>><h1>Chapter 1</h1>
    >>><h2>Section 1</h2>
    >>><h3>Paragraph 1</h3>
    >>><p>...........</p>
    >>><h3>Paragraph 2</h3>
    >>><p>...........</p>
    >>><h3>Paragraph 3</h3>
    >>><p>...........</p>
    >
    >
    >
    >
    >
    >
    >
    > -------------------
    > (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    > in the body of the message to majordomo@renderx.com from the address
    > you are subscribed from.
    > (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
    >
    >

    -- 
    Werner Donné  --  Re BVBA
    Engelbeekstraat 8
    B-3300 Tienen
    tel: (+32) 486 425803	e-mail: werner.donne@re.be
    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
    


    This archive was generated by hypermail 2.1.5 : Wed Sep 29 2004 - 14:29:08 PDT