Orbeon:提高 Orbeon 代码的可重用性
如果有多个日期字段具有相同的约束或多个文本区域具有相同的约束
是否可以在类似的约束中重用绑定使用的约束?
假设文本区域 1 有约束
if(string-length(.) > 500)
then substring(.,1,500)
else .
,文本区域 2 有约束,
if(string-length(.) > 500)
then substring(.,1,500)
else .
是否可以在公共位置具有约束,并在每次绑定时调用特定约束并重用代码?
If there are multiple date fields that have the same constraint or multiple text-area with the same constraint
Is it possible to reuse the constraint used by a bind, across similar constraints?
say text-area 1 has constraint
if(string-length(.) > 500)
then substring(.,1,500)
else .
and text-area 2 has constraint
if(string-length(.) > 500)
then substring(.,1,500)
else .
is it possible to have the constraint at a common location and at each bind call the particular constraint and reuse the code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以声明一个
bind
,其中nodeset
表达式指向与两个文本区域相对应的两个节点。例如:(将来,定义更像可重用 XPath 表达式的函数的功能可能会添加到 XForms 中,从而允许您在其他情况下轻松重用 XPath 表达式。)
You can declare a single
bind
where thenodeset
expression points to the two nodes corresponding to your two text areas. For instance:(In the future, a capability to define functions that are more like reusable XPath expressions might be added to XForms, allowing you to also easily reuse XPath expressions in other situations.)