Orbeon:如何设置<xhtml:a>标签的href,基于<xforms:repeat>中的当前节点?</xforms:repeat> </xhtml:a>

时间:2012-12-01 17:16:29

标签: orbeon

我正在尝试根据xforms:repeat中当前节点的叶子值设置标签的href属性。我尝试过不同的语法,但无法使其正常工作。这是我的最后一次尝试(使用xforms:var)。注意:迭代和列表都没问题,只是href不是(空指针异常)。

<xforms:repeat id="sous_menu_branches" nodeset="./Branches/Branche">
    <xhtml:li>
         <xforms:var name="brancheId" value="./BrancheId"/>
         <xhtml:a href="/notes-saisie/?brancheId={$brancheId}">         
             <xforms:output ref="Nom" mediatype="text/html"/>
         </xhtml:a>
     </xhtml:li>
</xforms:repeat>

实际上,当我尝试在我的视图(view.xsl)中使用xforms:var时,我总是遇到java null指针错误。例如,在下面的代码片段中,第一个xforms:output抛出异常,但不抛出第二个异常(它应该访问相同的值):

 <xforms:repeat id="sous_menu_branches" nodeset="./Branches/Branche">
     <xhtml:li>
         <xforms:var name="current-item" value="."/>
         <xforms:output id="my-count" ref="$current-item/Nom"/>
         <xhtml:a href="/notes-saisie/?brancheId=888">        
             <xforms:output ref="./Nom" mediatype="text/html"/>
         </xhtml:a>
     </xhtml:li>
 </xforms:repeat>

有谁能告诉我我做错了什么?提前谢谢!

1 个答案:

答案 0 :(得分:0)

您没有说您正在使用哪个版本的Orbeon Forms,但我怀疑您使用的是尚未支持xforms:var的版本。请尝试使用xxforms:variable