首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ant xmltask节点

ant xmltask节点
EN

Stack Overflow用户
提问于 2014-07-07 11:25:33
回答 1查看 1K关注 0票数 1

我的新问题是如果条件标签。

事实上,当"param“是0时,我不能进入‘那么’的条件。

代码语言:javascript
复制
<xmltask source="rapport.xml">                                      
    <call path="//testsuites">
        <param name="chaine" path="@name"/>
        <param name="testsuite1" path="testsuite[1]/@name"/>
        <param name="testsuite2" path="testsuite[2]/@name"/>                                
        <param name="ko1" path="count(testsuite[1]/testcase/failure[@type='ko'])"/>
        <actions>   
            <echo message="count fichiers ko 1 : @{ko1}"/>
            <if>
                <equals arg1="${ko1}" arg2="0" />
                <then>
                    <echo message="OK"/>
                </then>
                <else>                              
                    <echo message="KO"/>                            
                </else>
            </if>                           
        </actions>
    </call>                               
</xmltask>

为什么我不能进入“然后”条件,而只能在"arg1“=0时进入”only“?

rapport.xml是:

代码语言:javascript
复制
<testsuites name="COMPTES" tests="6" time="7" timestamp="2014-07-01T17-20-07" failures="6" errors="0">
    <testsuite name="100" tests="6" failures="6" errors="0" time="7">
        <testcase classname="Script.COMPTES.100" name="TEST1" time="1">
            <failure message="Not exist file or counter or used" type="fichiersInexistants">
                File No matches
            </failure>
        </testcase>
        <testcase classname="Script.COMPTES.100" name="TEST2" time="2">
            <failure message="Not exist file or counter or used" type="fichiersUtilises">
                Data set in use
            </failure>
        </testcase>
        <testcase classname="Script.COMPTES.100" name="TEST3" time="3">
            <failure message="Not exist file or counter or used" type="fichiersInexistants">
                File No matches
            </failure>
        </testcase>
        <testcase classname="Script.COMPTES.100" name="TEST4" time="3">
            <failure message="File abended" type="abended">
                File abended
            </failure>
        </testcase>
    </testsuite>
</testsuites>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-07-07 11:36:37

尝试使用@{ko1}而不是${ko1}来引用参数。如果echo真的在打印0,那么它应该可以工作。

代码语言:javascript
复制
<echo message="count fichiers ko 1 : @{ko1}"/>
<if>
    <equals arg1="@{ko1}" arg2="0" />
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24609482

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档