Combining CSS and FO

gewe

Usenet Archive
Joined
Feb 6, 2008
Messages
1
Reaction score
0
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">
 

Joseph Kesselman

Usenet Archive
Joined
Feb 3, 2006
Messages
733
Reaction score
0
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.
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
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.
 

Peter Ring

Usenet Archive
Joined
Jan 10, 2002
Messages
2
Reaction score
0
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
548,049
Messages
3,104,246
Members
248,133
Latest member
DujonT

Latest Threads

Top