Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 如何使用;或条件“;在xsl中:何时在XSLT(IBM Watson Explorer)中?_Xml_Xslt_Ibm Watson_Watson - Fatal编程技术网

Xml 如何使用;或条件“;在xsl中:何时在XSLT(IBM Watson Explorer)中?

Xml 如何使用;或条件“;在xsl中:何时在XSLT(IBM Watson Explorer)中?,xml,xslt,ibm-watson,watson,Xml,Xslt,Ibm Watson,Watson,我正在尝试为我的以下XML创建XSLT: <?xml version="1.0" encoding="UTF-8"?> <results> <headline> <a href="/bin-public/xyz/documents/customer-service/durable-power-of-bank.pdf"></a>

我正在尝试为我的以下XML创建XSLT:

<?xml version="1.0" encoding="UTF-8"?> 
    <results>
                <headline>
                  <a href="/bin-public/xyz/documents/customer-service/durable-power-of-bank.pdf"></a>
                  </headline>     
                  <linkPDF><a href="www.xyz.com"></a></linkPDF> 
     </results>
     <results>
                    <headline>
                     <a href="www.example.com"></a>
                     </headline>     
                    <linkPDF></linkPDF>
   </results>
    <results>
                   <headline>
                   <a href="www.example.html"></a>
                    </headline>     
                    <linkPDF><a href="www.abc.com"></a></linkPDF> 
     </results>

我想添加两个条件:headline/href包含非pdf端点URL的位置或linkPDF包含任何值的位置

这是我的XSLT条件,但它不起作用:

<xsl:when test="not(viv:test(./headline/a/@href,'*.pdf','wc')) or 'linkPDF/a/href'">
 <!-- do something -->
 </xsl:when>

那么,我如何在viv:test中使用“或”条件呢?或者我可以在不使用XSLT中的viv:test的情况下做同样的事情吗?如果有任何帮助,我将不胜感激。

更改

or 'linkPDF/a/href'


表达式的第二项而不是字符串文本中计算XPath。

为什么第二个操作数用单引号括起来?
or linkPDF/a/href