0
第一篇文章希望有人能幫忙。基本上,我通過xslt輸出pdf,我的問題是我有一張表,我只希望在表中包含內容時生成該表。我相信我的電話模板始終會啓動,因此即使沒有內容,也始終至少恢復表格標題行。我不希望桌子出現。提前致謝。有條件地調用模板xslt
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:a="http://www.appian.com/ae/types/2009">
<div id="processVariables">
<xsl:call-template name="applicantDetails" />
</div>
<xsl:call-template name="pp" />
<xsl:call-template name="processMilestoneList" />
<xsl:call-template name="processCommentList" />
</div>
<div id="pageFooter" />
</body>
</html>
<xsl:template name="processCommentList">
<div id="processCommentList">
<th space-before ="12pt" keep-with-next="always" font-weight="bold">Process comments:</th>
<table>
<tr>
<th id="date">Date</th>
<th id="user">User</th>
<th id="comment">Comment</th>
</tr>
<xsl:for-each select="//processCommentList/item">
<tr>
<td>
<xsl:call-template name="DisplayDate">
<xsl:with-param name="dateString">
<xsl:value-of select="date"/>
</xsl:with-param>
</xsl:call-template>
</td>
<td>
<xsl:variable name="commentUser">
<xsl:value-of select="user"/>
</xsl:variable>
<xsl:value-of select="//a:processManifest/a:processUserList/a:User[username/@a:id=$commentUser]/fullName/text()"/>
</td>
<td>
<xsl:value-of select="comment" />
</td>
</tr>
</xsl:for-each>
</table>
</div>