这是我的自定义控件:
<?xml version="1.0" encoding="UTF-8"?>
<xbl:xbl xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
xmlns:xbl="http://www.w3.org/ns/xbl">
<metadata xmlns="http://orbeon.org/oxf/xml/form-builder">
<display-name lang="en">Custom Controls</display-name>
</metadata>
<xbl:binding id="fb-input-country-selector" element="xforms|country-selector">
<metadata xmlns="http://orbeon.org/oxf/xml/form-builder">
<display-name lang="en">Country Selector</display-name>
<icon lang="en">
<small-icon>/forms/orbeon/builder/images/dropdown.png</small-icon>
<large-icon>/forms/orbeon/builder/images/dropdown.png</large-icon>
</icon>
<datatype>xforms:string</datatype>
<template>
<xforms:select1 id="" appearance="minimal" ref="" xmlns="">
<xforms:label ref=""/>
<xforms:hint ref=""/>
<xforms:help ref=""/>
<xforms:alert ref="$fr-resources/detail/labels/alert"/>
<xforms:item>
<xforms:label>[Select...]</xforms:label>
<xforms:value/>
</xforms:item>
<xforms:itemset nodeset="doc('oxf:/apps/xforms-controls/services/countries.xml')/countries/country">
<xforms:label ref="name"/>
<xforms:value ref="us-code"/>
</xforms:itemset>
</xforms:select1>
</template>
</metadata>
</xbl:binding>
</xbl:xbl>
问题是数据项不是从 XML 中获取的,但是如果我在表单结构中引入模板本身,它就可以工作。
有人有什么想法吗?