xsltrtfwordperfect

RTF file with tables looks broken in WordPerfect


I am creating RTF file using a XSL template. The content of the file includes a table. While the table appears nicely in a Ms Word Processor, it looks garbled up in Wordperfect. I have clients who use Wordperfect so it is a requirement for me to make it work with WP.

The XSL template to generate RTF looks like this

\rtf1\ansi
{\fonttbl
{\f20\fnil\fcharset0 Times New Roman;}
{\f21\fnil\fcharset0 Times New Roman;}
{\f22\fnil\fcharset0 Times New Roman;}
{\f23\fnil\fcharset0 Times New Roman;}
{\f24\fnil\fcharset0 Times New Roman;}
}
{\stylesheet
}
{\header
\pard\tqc\tx4320\tqr\tx8640 {\plain \f20\fs22 FileName: <xsl:value-of select="/file/document/title"/>}
}
{\footer
}

The template that creates table looks like this:

<xsl:for-each select="//tag/tag1">
\trowd \trq1 \trgraph120 \trleft-108
\clbrdrl\brdrs\clbrdrt\brdrs\clbrdrr\brdrs\clbrdrb\brdrs\cellx500
\clbrdrl\brdrs\clbrdrt\brdrs\clbrdrr\brdrs\clbrdrb\brdrs\cellx4200
\clbrdrl\brdrs\clbrdrt\brdrs\clbrdrr\brdrs\clbrdrb\brdrs\cellx7000
\clbrdrl\brdrs\clbrdrt\brdrs\clbrdrr\brdrs\clbrdrb\brdrs\cellx7500
\clbrdrl\brdrs\clbrdrt\brdrs\clbrdrr\brdrs\clbrdrb\brdrs\cellx9500
\pard
\nowidctlpar \intb1 \q1 \sa160 {\plain \f24\fs22 <xsl:value-of select="position()"/>} \cell \pard
\nowidctlpar \intb1 \q1 \sa160 {\plain \f24\fs22 <xsl:value-of select="item/text()"/>} \cell \pard
\nowidctlpar \intb1 \q1 \sa160 {\plain \f24\fs22 <xsl:value-of select="title/text()"/>} \cell \pard
\nowidctlpar \intb1 \q1 \sa160 {\plain \f24\fs22 <xsl:value-of select="page/text()"/>} \cell \pard
\nowidctlpar \intb1 \q1 \sa160 {\plain \f24\fs22 } \cell \pard
\widctlpar \intb1 \row
</xsl:for-each>

Is there a certain standard I should follow for tables to show up correctly in Word Perfect? Thanks for your help.


Solution

  • It was a painstaking process, but I finally figured it out.

    I am supposed to use this for cell borders to appear in both WP and Word.

    \clbrdrt\brdrs\brdrw16\brdrcf2\clbrdrl\brdrs\brdrw16\brdrcf2\clbrdrb\brdrs\brdrw16\brdrcf2\clbrdrr\brdrs\brdrw16\brdrcf2\cellx1000
    

    Each 4 tags indicate a cell-border. Example: \clbrdrt : Cell border right top \brdrs : single border \brdrw16 : width = 16 \brdrcf2 : not sure what this means

    And the code was also using intb1 instead of intbl