2014-07-07 9 views
0

내 새로운 문제는 if 조건 태그입니다. "PARAM"나는하지만 "다른"잠시에서 "다음"상태로 얻을 수없는 이유는 무엇 0개미 xmltask 노드의 경우

<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?

rapport.xml은 :

<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> 
+0

XML 소스 란 rapport.xml을 의미합니다. – Rebse

+0

Manouti의 답변이 적절합니다. xmltask documentation => http://www.oopsconsultancy.com/software/xmltask/ => "이 예제에서 매개 변수가 역 참조되는 방식에주의하십시오 (@ {...} 사용). 또한 임베디드 작업의 경우 각 속성은 의심스러운 경우 명령어의 기본 속성을 사용하십시오. " – Rebse

답변

0

파라미터를 참조 @{ko1} 대신 ${ko1}을 사용한 것을 시도. echo이 실제로 0을 인쇄하는 경우 제대로 작동합니다.

<echo message="count fichiers ko 1 : @{ko1}"/> 
<if> 
    <equals arg1="@{ko1}" arg2="0" /> 
+0

대단히 감사합니다 @ 마누 이제, 그것이 작동 :) – stella06700