在XSLT中针对多个值之一进行测试?

时间:2017-12-06 16:39:45

标签: xml xslt

道歉我没有编码经验。

这行代码阻止我的报告导出所有product_types。是否可以将其更改为product_type='configurable','other' <xsl:if test="(product_type='configurable')">

def cutoff_youdens_j(fpr,tpr,thresholds):
    j_scores = tpr-fpr
    j_ordered = sorted(zip(j_scores,thresholds))
    return j_ordered[-1][1]

我显然已尝试进行上述更改,但它们无效。

1 个答案:

答案 0 :(得分:0)

始终:

<xsl:if test="true()">

<强>从不:

<xsl:if test="false()">

多个案例(XSLT 1.0):

<xsl:if test="(product_type = 'configurable') or (product_type = 'other')">

多个案例(XSLT 2.0 +):

<xsl:if test="product_type = ('configurable', 'other')">

定义,无论价值如何:

<xsl:if test="product_type">