【问题标题】:Can we apply AVT for attribute 'id' in Orbeon Xforms我们可以在 Orbeon Xforms 中为属性“id”应用 AVT
【发布时间】:2012-03-05 13:49:39
【问题描述】:

感谢 SO 在我的 previous question 中告诉我有关 AVT 的信息。

我认为 AVT 可以应用于所有属性,但我发现它不适用于属性 id。我read W3C 建议并了解到AVT 不能应用于所有属性。

请有人告诉我这是否适用于 Orbeon Xforms。

示例代码(在沙盒中播放!):

<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:odt="http://orbeon.org/oxf/xml/datatypes"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:sql="http://orbeon.org/oxf/xml/sql"
    xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
    xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:saxon="http://saxon.sf.net/"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:oxf="http://www.orbeon.com/oxf/processors"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
    xmlns:exforms="http://www.exforms.org/exf/1-0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"
    xmlns:f="http://orbeon.org/oxf/xml/formatting"
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:exf="http://www.exforms.org/exf/1-0"
    xmlns:xbl="http://www.w3.org/ns/xbl"
    xmlns:date="http://exslt.org/dates-and-times">

<xhtml:head>
  <xhtml:title>Address Details</xhtml:title>

  <xforms:model>
     <xforms:instance id="address-details" xmlns="">
        <form>
            <address>
                <address-1></address-1>
            </address>
        </form>
     </xforms:instance>

    <xforms:bind id="address-1" nodeset="instance('address-details')/address/address-1" 
                readonly="false()"
                constraint="string-length(.) &lt;= 15"/>
    <xxforms:variable name="id-name" select="CONTROL-ID" />

  </xforms:model>
</xhtml:head>

<xhtml:body>

    <table>
        <tr>
            <td>
                Address 1:
            </td>
            <td>
                <xforms:input bind="address-1" incremental="true" id="{$id-name}">
                    <xforms:alert>Maximum allowed characters are 15</xforms:alert>
                </xforms:input>
            </td>
        </tr>
    </table>

</xhtml:body>

</xhtml:html>

我们可以看到显示 AVT 未被解释的 HTML 源代码。

我知道表单运行器会将动态名称附加到 id 值,但这对我来说很好。

请有人告诉我这是否适用于 Orbeon Xforms。

【问题讨论】:

    标签: orbeon xforms


    【解决方案1】:

    简单的答案:AVT 不适用于 XForms 元素的 id 属性。您必须静态选择一个 id。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-11
      • 1970-01-01
      • 2011-04-12
      相关资源
      最近更新 更多