Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Combining CSS and FO

Reply
Thread Tools

Combining CSS and FO

 
 
gewe
Guest
Posts: n/a
 
      02-06-2008
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">
 
Reply With Quote
 
 
 
 
Joseph Kesselman
Guest
Posts: n/a
 
      02-06-2008
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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      02-06-2008
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/
 
Reply With Quote
 
Peter Ring
Guest
Posts: n/a
 
      02-08-2008
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">

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Whining and bitching about MSIE 6 CSS bugs and CSS support =?ISO-8859-1?Q?G=E9rard_Talbot?= HTML 0 07-09-2005 06:48 AM
ASP.NET 3.0: Compelling scenarios for combining Master Pages and Web Parts? Michael Herman \(Parallelspace\) ASP .Net 5 07-05-2005 12:19 PM
Combining numeric mode paging and nextPreview paging in datagrid Red ASP .Net 1 03-12-2005 11:41 PM
T-bird and combining messages Dudhorse Firefox 2 11-12-2004 11:55 PM
Combining forms and Windows authentication Nils Magnus Englund ASP .Net 0 04-19-2004 12:09 PM



Advertisments