2013-11-27 7 views
0

를하는 XForms if 성명? 트리 메뉴 소스를 만듭니다. 때문에 XPath는 2.0의나는 내가 다음 코드를 실행 오류가 발생 코드

<html 
    xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:xf="http://www.w3.org/2002/xforms" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:ev="http://www.w3.org/2001/xml-events"> 
    <head> 
     <title>Folding Menus</title> 
     <xf:model id="modelID" ev:event="" functions="" schema=""> 
     <xf:instance id="instanceData" xmlns=""> 
      <group id="mainGroup"> 
       <group id="group1" fold="0" category="Category One"> 
        <item id="item1">Enter Data</item> 
        <item id="item2">Enter Data</item> 
        <item id="item3">Enter Data</item> 
        <group id="group2" fold="0" category="Category Two"> 
        <item id="item4">Enter Data</item> 
        <item id="item5">Enter Data</item> 
        <group id="group3" fold="0" category="Category Three"> 
         <item id="item6">Enter Data</item> 
         <item id="item7">Enter Data</item> 
         <item id="item8">Enter Data</item> 
        </group> 
        <item id="item9">Enter Data</item> 
        </group> 
       </group> 
      </group> 
     </xf:instance> 
     <xf:instance id="foldedNodes" xmlns=""> 
      <foldednodes> 
       <nodelist /> 
      </foldednodes> 
     </xf:instance> 

     <xf:bind nodeset="descendant::*" 
      relevant="not(contains(instance('foldedNodes')/nodelist, current()/parent::*/@id))" 
      /> 
     </xf:model> 

     <style type="text/css"> 
     @namespace xhtml url("http://www.w3.org/1999/xhtml"); 
     @namespace xf url("http://www.w3.org/2002/xforms"); 
     xf|*:disabled { 
     display: none; 
     } 
     </style> 

    </head> 

    <body> 

     <div class="header">Folding Test</div> 

     <xf:group id="mainGroup"> 
     <xf:output ref="instance('foldedNodes')/nodelist"> 
      <xf:label>ID List</xf:label> 
     </xf:output> 
     <xf:repeat nodeset="instance('instanceData')/descendant::group" id="repeatGroup"> 
      <xf:output class="outputInline" 
       value="concat(substring('&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;',1,3 * count(current()/ancestor::*)), '&#160;&#160;&#160;&#160;&#160;')" /> 
      <xf:trigger> 
       <xf:label> 
        <xf:output 
        value="if(contains(instance('foldedNodes')/nodelist, ./@id), '+', '-')" 
        /> 
       </xf:label> 
       <xf:action ev:event="DOMActivate"> 
        <xf:setvalue ref="instance('foldedNodes')/nodelist" 
        value="if(contains(instance('foldedNodes')/nodelist, instance('instanceData')/descendant::group[position()=index('repeatGroup')]/@id), concat(substring-before(instance('foldedNodes')/nodelist, instance('instanceData')/descendant::group[position()=index('repeatGroup')]/@id), substring-after(instance('foldedNodes')/nodelist, instance('instanceData')/descendant::group[position()=index('repeatGroup')]/@id)), concat(instance('foldedNodes')/nodelist, instance('instanceData')/descendant::group[position()=index('repeatGroup')]/@id))" 
        /> 
       </xf:action> 
      </xf:trigger> 
      <xf:output class="outputInline" ref="./@category" /> 
      <xf:repeat nodeset="./item" id="repeatItem"> 
       <xf:output class="outputInline" 
        value="concat(substring('&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;',1,3 * count(current()/ancestor::*)), '&#160;&#160;&#160;&#160;&#160;')" /> 
       <xf:output class="outputInline" ref="./@id"> 
        <xf:label>id: </xf:label> 
       </xf:output> 
       <xf:input class="inputInline" ref=".[name() = 'item' or name() = 'file']"> 
        <xf:label>data: </xf:label> 
       </xf:input> 
      </xf:repeat> 
     </xf:repeat> 
     </xf:group> 

    </body> 
</html> 

답변

0

는, "만일"함수가 사용되지 않습니다으로 트리 메뉴를 참조하십시오, 당신은 다른 소스가 있으면 알려 주시기 바랍니다. 대신 "선택"을 시도해야합니다.

-alain