英文:
Orbeon Forms: IF/THEN/ELSE Statement using Actions with xPath
问题
我在这个帖子中尝试了这两个 IF 语句,但都不起作用。
但是,如果删除 type="xpath" 语句(参见此表单),它们可以正常工作。
那么,如何在具有 type="xpath" 语句的情况下使用动作:
- 在动作头中使用 If/then/else
- 在动作体中使用 If/then/else
一个简单的示例将会很有帮助。
非常感谢
PeteA
英文:
I tried both of these IF statements in this post, but neither work.
However, they do work OK if you remove the type="xpath" statement ( see this form).
So how can you use an action with the type="xpath" statement with:
- If/then/else in the action header
- If/then/else in action body
A simple example would be great.
Many thanks in advance
PeteA
答案1
得分: 2
那些示例不应该包含 type="xpath" 属性。我只是从答案中移除了这些属性,以避免可能的混淆。
type="xpath" 属性用于指定在 xf:action 上运行服务器端 XPath 脚本。这在使用具有副作用的扩展函数时特别有用。您可以在 调用服务器端 XPath 部分找到更多信息。
英文:
Those examples shouldn't have had that type="xpath" attribute. I just removed those attributes from that answer to avoid possible confusion.
The type="xpath" attribute on an xf:action is used to specify that the action should run a server-side XPath script. This is particularly useful when using extension functions that have side effects. You can find more about this in the section Calling server-side XPath.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论