首页 > 解决方案 > 如何在 XSL-FO 中的第一次匹配之前插入表头?

问题描述

你好。

我有一个不寻常的情况,即基于一系列条件构建产品表。但是,由于处理 XSL 的工具的限制,我需要在选择/当语句的第一个结果之前插入一个标题。

我试过这个无济于事:

                     <xsl:when test="number(translate($_dsSub1/lotCharges_l, ',', '.'))&#62;&#39;0&#39; or number(translate($_dsSub1/price/_price_item_price_each, ',', '.'))&#62;&#39;0&#39; or $_dsSub1/leadTimeMax_l&#62;&#39;0&#39; and $_dsSub1/item_l/_part_custom_field8 = &#39;Services&#39;">
                        <xsl:choose>                      
                          <xsl:when test="position() = 1">
                            <h1>Table Header goes here</h1>
                          </xsl:when>
                          <xsl:otherwise>0</xsl:otherwise>
                        </xsl:choose>
                        <fo:table-row keep-together.within-page="1" padding="5px" margin="0px" border-collapse="collapse" top="0px" bottom="0px" height="5px">
...```

标签: xsltxsl-fo

解决方案


我最终将条件逻辑从各个表行中移出,并将 where 子句放在构建表之前。


推荐阅读