XSL FO support for CSS

J

james

Hi there!

I'm trying to convert an HTML file to CSS and I have problems
reading the CSS attributes.

For example: for table attribute:

<xsl:attribute-set name="table.data">
<xsl:attribute name="table-layout">fixed</xsl:attribute>
<xsl:attribute name="space-before">10pt</xsl:attribute>
<xsl:attribute name="space-after">10pt</xsl:attribute>
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-width">2pt</xsl:attribute>
</xsl:attribute-set>

I use:


<xsl:template match="table">
<fo:table xsl:use-attribute-sets="table.data">
<xsl:if test="@layout">
<xsl:attribute name="table-layout">
<xsl:value-of select="@layout"/>
</xsl:attribute>
</xsl:if>

<xsl:if test="@border">
<xsl:attribute name="border-width">
<xsl:value-of select="@border"/>pt
</xsl:attribute>
</xsl:if>
<xsl:if test="@width">
<xsl:attribute name="inline-progression-dimension">
<xsl:value-of select="@width"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="tr[1]/th|tr[1]/td">
<fo:table-column>
<xsl:if test="@colspan">
<xsl:attribute name="number-columns-repeated">
<xsl:value-of select="@colspan"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="column-width">
<xsl:value-of select="floor(@width div 72)"/>in
</xsl:attribute>
</fo:table-column>
</xsl:for-each>
<fo:table-body>
<xsl:apply-templates/>
</fo:table-body>
</fo:table>
</xsl:template>

<!-- Table Row -->
<xsl:template match="tr">
<fo:table-row>
<xsl:apply-templates/>
</fo:table-row>
</xsl:template>

but when I get in the HTML a line with:
<table cellpadding="0" cellspacing="0" class="vlargetextb"
style="border: thin solid Black; border-top-width: 1;
border-bottom-width: 1; border-left-width: 1; border-right-width: 1;
border-left: 1 solid Black; border-right: 1 solid Black;">

Anyone knows how to interpret the style field in the table
declaration?

Thanks
james
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top