我的 xml 数据的某个元素应符合以下条件之一:
1.) 它有一个@when 属性,没有别的。
2.) 它有一个 @when-iso 属性,没有别的。
3.) 它同时具有@notBefore-iso 和@notAfter-iso 属性,但既没有@when 也没有@when-iso 属性。
我尝试使用 schematron 进行测试,但无法创建匹配的 xpath 表达式。
我试过了
<assert test="@when or @when-iso or (not(@when) and not(@when-iso) and @notBefore-iso and @notAfter-iso)">
但这不起作用。显然,括号中的内容被简单地忽略了。那么,如何构建复杂/嵌套的条件表达式?