Php 基于PDF格式的XSL 建议uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

Php 基于PDF格式的XSL 建议uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu,php,xsl-fo,Php,Xsl Fo,嘿,伙计们。。我在做一个项目,遇到了这个小问题。。每当“”中的“student_name”有值时,它都会显示: 输出:建议John DOE将收到 以下服务/安置 我怎样才能想出一个解决方案,只要“学生名”不是 设置后,它将只显示“建议\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 将接受以下服务/安置。”?帮帮我。看看 将接受以下服务/安置: 这不是一个有效的例子,但我希望它能让你知道在哪里可以看到 首

嘿,伙计们。。我在做一个项目,遇到了这个小问题。。每当“”中的“student_name”有值时,它都会显示:

输出:建议John DOE将收到 以下服务/安置

我怎样才能想出一个解决方案,只要“学生名”不是 设置后,它将只显示“建议\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu 将接受以下服务/安置。”?帮帮我。

看看


将接受以下服务/安置:
这不是一个有效的例子,但我希望它能让你知道在哪里可以看到

首先,请看一下文档。阅读所有文档不超过15-20分钟

您可以简单地使用xsl:if语句,它允许您测试节点是否在那里,就像您在使用xsl:choose时所做的那样,但是您可能可以在这样一行中实现您想要的结果

<fo:block>
<xsl:choose>
  <xsl:when test="/root/demo/student_name != ''">
     <xsl:value-of select="/root/demo/student_name"/>
  </xsl:when>
  <xsl:otherwise>
    <fo:inline text-decoration="underline">   </fo:inline> 
  </xsl:otherwise>
</xsl:choose>
will receive the following services/placement: 
</fo:block>

建议uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
这将检查是否存在student_name节点,如果要检查该节点是否为空,则可以使用!=比较器,但在这种情况下它似乎没有必要,因为如果它是空的,如果您不以任何主要方式更改间距或位置,它应该不会造成任何影响

<fo:block>
<xsl:choose>
  <xsl:when test="/root/demo/student_name != ''">
     <xsl:value-of select="/root/demo/student_name"/>
  </xsl:when>
  <xsl:otherwise>
    <fo:inline text-decoration="underline">   </fo:inline> 
  </xsl:otherwise>
</xsl:choose>
will receive the following services/placement: 
</fo:block>
<fo:block>

It has been recommended that _______________<xsl:if test="/root/demo/student_name"><fo:inline text-decoration="underline"><xsl:value-of select="/root/demo/student_name"/></fo:inline></xsl:if> will receive the following services/placement:      

</fo:block>