Combining CSS and FO

G

gewe

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">
 
J

Joseph Kesselman

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

Martin Honnen

gewe said:
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.
 
P

Peter Ring

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top