PDF 视图中缺少 CALS 表格边框线 (XSLT)

拉贾兰潘迪安

这是我的示例 CALS 表 XML 结构。

<table id="table_Test" frame="none">
  <tgroup cols="7">
    <colspec colname="cgen1"/>
    <colspec colname="c1" colwidth="10*"/>
    <colspec colname="c2" colwidth="10*"/>
    <colspec colname="c3" colwidth="10*"/>
    <colspec colname="c4" colwidth="10*"/>
    <colspec colname="c5" colwidth="10*"/>
    <colspec colname="cgen2"/>
    <thead>
      <row>
        <entry rowsep="0" colsep="0"/>
        <entry colsep="0"/>
        <entry colsep="0"/>
        <entry colsep="0"/>
        <entry colsep="0"/>
        <entry colsep="0"/>
        <entry rowsep="0" morerows="0"/>
      </row>
      <row>
        <entry rowsep="0" colsep="1" morerows="0"/>
        <entry align="center"><para>Test1</para></entry>
        <entry align="center"><para>Test2</para></entry>
        <entry align="center"><para>Test3</para></entry>
        <entry align="center"><para>Test4></entry>
        <entry align="center"><para>Test5</para></entry>
        <entry rowsep="0" morerows="0"/>
      </row>
    </thead>
    <tbody>
      <row>
        <entry rowsep="0" morerows="0"/>
        <entry>
          <para> Test6</para>
        </entry>
        <entry>Test 7</entry>
        <entry>
          <para>Test 8</para>
        </entry>
        <entry>
          <para>Test 9</para>
        </entry>
        <entry>
          <para>Test 10</para>
        </entry>
        <entry rowsep="0" morerows="0"/>
      </row>
      <row>
        <entry rowsep="0" colsep="0" morerows="0"/>
        <entry rowsep="0"/>
        <entry><para>Test 11</para></entry>
        <entry><para>Test 12</para></entry>
        <entry><para>Test 13</para></entry>
        <entry rowsep="0" colsep="0"/>
        <entry rowsep="0" morerows="0"/>
      </row>
      <row>
        <entry rowsep="0" colsep="0" morerows="0"/>
        <entry rowsep="0"/>
        <entry><para>Test 14</para></entry>
        <entry/>
        <entry/>
        <entry rowsep="0" colsep="0"/>
        <entry rowsep="0" morerows="0"/>
      </row>
      <row>
        <entry rowsep="0" colsep="0" morerows="0"/>
        <entry rowsep="0"/>
        <entry><para>Test 15</para></entry>
        <entry/>
        <entry/>
        <entry rowsep="0" colsep="0"/>
        <entry rowsep="0" morerows="0"/>
      </row>
      <row>
        <entry rowsep="0" colsep="0" morerows="0"/>
        <entry rowsep="0" colsep="0"/>
        <entry rowsep="0" colsep="0"/>
        <entry rowsep="0" colsep="0"/>
        <entry rowsep="0" colsep="0"/>
        <entry rowsep="0" colsep="0"/>
        <entry rowsep="0" colsep="0" morerows="0"/>
      </row>
    </tbody>
  </tgroup>
</table>

但 PDF 视图中缺少边框线。如何处理 XSLT 中的“rowsep”、“colsep”变量。我已将帧值设置为 none 。在此处输入图片说明

但我需要这样的输出 在此处输入图片说明

我是新来的 xslt 写作。请帮助我如何使用 XSLT 归档我的需求。我该如何解决这个问题?

霍布斯

你必须指定你想要一个边框,在这种情况下在每个上<entry>

fo:table-cell border="1pt solid black"

FO 表格边框样式

对于 @colsep 和 @rowsep 属性,您必须使边框有条件:

<fo:table-cell>
<xsl:if test="not(@colsep='0')">
    <xsl:attribute name="border-left">1pt solid black</xsl:attribute>
    <xsl:attribute name="border-right">1pt solid black</xsl:attribute>
</xsl:if>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章