XSLT或语句无法正常工作

Eri*_*itz 0 xslt

我在xslt中遇到了这个测试的问题

<xsl:if test="(count(dsQueryResponse/Rows/Row) == 0) or (dsQueryResponse/Rows/Row[1]/@Process != '')">
    <textarea>
         ....
    </textarea>
</xsl:if>
Run Code Online (Sandbox Code Playgroud)

如果,我想允许显示textarea

  • count(dsQueryResponse/Rows/Row)== 0
  • 或者,如果第一行的Process属性为空

Erl*_*ock 5

==不是有效的XPath运算符.要测试相等性,只需使用=.

<xsl:if test="(count(dsQueryResponse/Rows/Row) = 0) or (dsQueryResponse/Rows/Row[1]/@Process != '')">
    <textarea>
         ....
    </textarea>
</xsl:if>
Run Code Online (Sandbox Code Playgroud)