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
Xslt XSL:if测试或XSL:choose_Xslt - Fatal编程技术网

Xslt XSL:if测试或XSL:choose

Xslt XSL:if测试或XSL:choose,xslt,Xslt,XML: 您当前的测试格式不正确,因为引号中嵌入了引号。但主要问题是以开头将字符串作为第一个参数,而不是节点集。在XSLT1.0中,它将使用第一个节点的值。在XSLT2.0中,您将得到一个错误 你的表情应该是这样的 YES NO 这假设您位于inc\u事件元素上。当前测试的格式不正确,因为引号中嵌入了引号。但主要问题是以开头将字符串作为第一个参数,而不是节点集。在XSLT1.0中,它将使用第一个节点的值。在XSLT2.0中,您将得到一个错误 你的表情应该是

XML:


您当前的测试格式不正确,因为引号中嵌入了引号。但主要问题是
开头将字符串作为第一个参数,而不是节点集。在XSLT1.0中,它将使用第一个节点的值。在XSLT2.0中,您将得到一个错误

你的表情应该是这样的

                 YES   NO

这假设您位于
inc\u事件
元素上。

当前测试的格式不正确,因为引号中嵌入了引号。但主要问题是
开头将字符串作为第一个参数,而不是节点集。在XSLT1.0中,它将使用第一个节点的值。在XSLT2.0中,您将得到一个错误

你的表情应该是这样的

                 YES   NO

这假设您位于一个
inc\u事件
元素上。

Tim C提供的解决方案应进行如下细微更改

    <xsl:choose>
        <xsl:when test="inc_interventionprocedure/ProcedureID[starts-with(., 'Airway')]">
            <fo:inline>YES</fo:inline>
        </xsl:when>
        <xsl:otherwise>
            <fo:inline>NO</fo:inline>
        </xsl:otherwise>
    </xsl:choose>

X
X

Tim C提供的解决方案应进行如下细微更改

    <xsl:choose>
        <xsl:when test="inc_interventionprocedure/ProcedureID[starts-with(., 'Airway')]">
            <fo:inline>YES</fo:inline>
        </xsl:when>
        <xsl:otherwise>
            <fo:inline>NO</fo:inline>
        </xsl:otherwise>
    </xsl:choose>

X
X

请发布一个可复制的示例-我们可以单独通过复制和粘贴进行测试。用肉眼观察XML,有几个inc_interventionprocedure/ProcedureID节点—一些满足第一个测试,一些满足另一个测试。此外,您向我们展示的XSLT代码段无效(双引号中包含双引号)。请发布一个可复制的示例-我们可以通过复制和粘贴单独测试该示例。用肉眼观察XML,有几个inc_interventionprocedure/ProcedureID节点—一些满足第一个测试,一些满足另一个测试。此外,您向我们展示的XSLT代码段是无效的(双引号内有双引号)。“但主要问题是…”不会产生声明的结果。“但主要问题是…”不会产生声明的结果。这很有效。一个小小的改变能带来不同,真是不可思议。谢谢:-)这很有魅力。一个小小的改变能带来不同,真是不可思议。谢谢:-)
    <xsl:choose>
        <xsl:when test="inc_interventionprocedure/ProcedureID[starts-with(., 'Airway')]">
            <fo:inline>YES</fo:inline>
        </xsl:when>
        <xsl:otherwise>
            <fo:inline>NO</fo:inline>
        </xsl:otherwise>
    </xsl:choose>
<xsl:choose>
    <xsl:when test="inc_interventionprocedure/ProcedureID[starts-with(., 'Airway')]">
        <fo:inline>X</fo:inline>
        <fo:inline>&nbsp;</fo:inline>
    </xsl:when>
    <xsl:otherwise>
        <fo:inline>&nbsp;</fo:inline>
        <fo:inline>X</fo:inline>
    </xsl:otherwise>
</xsl:choose>