Orbeon Forms - 引用模板部分之外的控件值

Orbeon Forms - Referring to a control value outside a template section

使用 Orbeon Forms,我有一个具有嵌入式模板(库)部分的表单。我需要从主窗体中的控件检索一个值到模板部分中的控件。我在模板部分发现了一些关于类似问题的对话。

这听起来与我遇到的情况基本相同: http://discuss.orbeon.com/Retrieve-value-outside-library-section-template-td4663317.html

那里建议的方式没有按预期工作。建议使用函数 xxf:instance(),例如 xxf:instance('fr-form-instance')/mysection/mycontrol 应该有效。但是,当我将这样的功能添加到库中的控件时,我无法获取库部分之外的参考点。

为了调试,我 运行 在库部分控制中命令:saxon:serialize(xxf:instance('fr-form-instance'), 'xml')。这只返回了我 XML 的部分,其中仅包含主窗体的库部分,基本上是这样的:

<library-section>
    <grid>
        <controlInLibrary>Control value blah blah</controlInLibrary>
    </grid>
</library-section>

如果我 运行 在主表单部分使用相同的命令,我会得到整个表单,包括库部分:

<form>
    <another-section>
        <grid-another>
            <control1/>
            <control2/>
        </grid-another>
    </another-section>
    <library-section>
        <grid>
            <controlInLibrary>Control value</controlInLibrary>
        </grid>
    </library-section>
</form>

显然这里的例子 XML 是简化的。

这个 xxf:instance() 函数应该如何工作以获取库外的数据?我可能做错了什么?

根据另一个线程,我以相反的方式(从模板部分控件到主窗体控件的数据)工作,但这显然不能同时工作: Orbeon Form Builder - Referring to a control within a Section Template

从其他地方的 Orbeon 支持那里得到了答案。至少在我的例子中,可行的解决方案是函数是这样形成的:

xxf:instance('|fr-form-instance|')//outer-field

(//outer-field 显然是对主窗体上所需控件的引用。)