element.
The code, by some external information, knows that in place of any there is a specific XML structure (e.g. foo).
XQuery would be looking as /Root/Child/AnotherChild/book/title.
But XQuery complains that book element is not known, and XQuery thus is not valid.
How can I write a query so that XQuery would accept than anything in <any/> place can be matched dynamically, at runtime?
If environment is of any importance, it is Java, Oracle BPEL, SOA server 1.1.5.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
并不真正匹配“任何”元素 - 相反,它匹配范围内模式中某处声明的任何元素。
例如,以下模式定义了一个包含 xsd:any 的元素:
然而,以下查询将失败:
因为 my:Child 未在任何地方声明。
如果架构修改如下:
那么查询应该成功。当然,xsd:any 匹配的元素可能位于另一个命名空间中。
does not really match "any" element - rather, it matches any element declared somewhere in a schema in scope.
For example, the following schema defines an element containing xsd:any:
Nevertheless, the following query will fail:
because my:Child is declared nowhere.
If the schema is modified as follows:
then the query should succeed. Of course the element matched by xsd:any may be in another namespace.
这对我有用://book/title。
当然这样不够精确,当有多个时就无法使用。在架构中。对于我的架构来说,这已经足够了。
我仍然想知道什么是正确的方法(tm)。
This one worked for me: //book/title.
Of course this is not precise enough, and cannot be used when there are multiple <xsd:any> in the schema. For my schema though it is sufficient.
I still wonder though what would be the Right Way (tm).