CALS table PDF 视图 (XSLT) 中缺少边框线
CALS table border line missing in PDF view (XSLT)
这是我的示例 CALS table 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"
对于@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>
这是我的示例 CALS table 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"
对于@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>