Combining CSS and FO

Discussion in 'XML' started by gewe, Feb 6, 2008.

  1. gewe

    gewe Guest

    I have an XML and a FO (XSL) file. These are used by fop to produce a
    PDF.
    In the FO I have to specify attributes, like border-style, for every
    table and table cell.
    Is it possible to have a CSS (either embedded or referenced), just
    like in an HTML page?

    In the HTML CSS I would write:
    td { border-style: solid }

    In the FO I want something like:
    table-cell { border-style: solid }

    so I can use:
    <fo:table-cell>

    instead of:
    <fo:table-cell border-style="solid">
     
    gewe, Feb 6, 2008
    #1
    1. Advertising

  2. Normally, you would use XSLT to perform styling of XML documents to
    produce XSL-FO. (That's what XSLT was originally designed for, though it
    turns out to be a generally useful tool for converting one kind of
    document into another.) XSLT is actually more powerful than CSS -- CSS
    can only annotate existing document structure, whereas XSLT can
    rearrange data.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, Feb 6, 2008
    #2
    1. Advertising

  3. gewe wrote:
    > I have an XML and a FO (XSL) file. These are used by fop to produce a
    > PDF.
    > In the FO I have to specify attributes, like border-style, for every
    > table and table cell.
    > Is it possible to have a CSS (either embedded or referenced), just
    > like in an HTML page?
    >
    > In the HTML CSS I would write:
    > td { border-style: solid }
    >
    > In the FO I want something like:
    > table-cell { border-style: solid }
    >
    > so I can use:
    > <fo:table-cell>
    >
    > instead of:
    > <fo:table-cell border-style="solid">


    I am not familiar with details of XSL formatting objects and we hardly
    ever have any questions here about that. You might want to try the
    general XSL mailing list
    <URL:http://www.mulberrytech.com/xsl/xsl-list/>, it allows XSL:FO
    questions and I think has active regulars being familiar with that topic.

    The only "solution" I could suggest is to look into xsl:attribute-set
    <URL:http://www.w3.org/TR/xslt#attribute-sets>, that is XSLT's way to
    allow you to define a set of attributes once and reuse it later.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Feb 6, 2008
    #3
  4. gewe

    Peter Ring Guest

    http://www.re.be/css2xslfo/

    CSSToXSLFO is a utility which can convert an XML document, together with
    a CSS2 style sheet, into an XSL-FO document, which can then be converted
    into PDF, PostScript, etc. with an XSL-FO-processor. It has special
    support for the XHTML vocabulary, because that is the most obvious
    language it would be used for. The tool has a number of page-related
    extensions. It also comes with an API in the form of an XML filter.


    http://princexml.com/

    Prince is a computer program that converts XML and HTML into PDF
    documents. Prince can read many XML formats, including XHTML and SVG.
    Prince formats documents according to style sheets written in CSS.


    http://www.realobjects.com/PDFreactor.808.0.html

    RealObjects PDFreactor is a powerful formatting processor for converting
    HTML and XML content into PDF documents. It uses Cascading Style Sheets
    (CSS) to define page layout and styles.


    kind regards
    Peter Ring

    gewe wrote:
    > I have an XML and a FO (XSL) file. These are used by fop to produce a
    > PDF.
    > In the FO I have to specify attributes, like border-style, for every
    > table and table cell.
    > Is it possible to have a CSS (either embedded or referenced), just
    > like in an HTML page?
    >
    > In the HTML CSS I would write:
    > td { border-style: solid }
    >
    > In the FO I want something like:
    > table-cell { border-style: solid }
    >
    > so I can use:
    > <fo:table-cell>
    >
    > instead of:
    > <fo:table-cell border-style="solid">
     
    Peter Ring, Feb 8, 2008
    #4
    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. Nils Magnus Englund

    Combining forms and Windows authentication

    Nils Magnus Englund, Apr 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,430
    Nils Magnus Englund
    Apr 19, 2004
  2. Red
    Replies:
    1
    Views:
    737
  3. Michael Herman \(Parallelspace\)
    Replies:
    5
    Views:
    3,042
    Juan T. Llibre
    Jul 5, 2005
  4. Phil
    Replies:
    3
    Views:
    3,316
    Randy Webb
    Mar 3, 2006
  5. Kjell Kristiansson

    Combining Anonymous and Domain logon

    Kjell Kristiansson, Dec 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    456
    cbDevelopment
    Dec 12, 2005
Loading...

Share This Page