数据库中XML中的不同xpath

时间:2015-07-28 15:30:40

标签: xml oracle

我在oracle数据库的表中有一个XMLType列。 每列可以在此列中包含不同的XML标记集。某些标签可以存在于一行中而在其他行中缺少。 如何找到所有可能的XML路径的超集,以便我不会错过此XML中的任何值。 对于缺少的标签,我将使用NULL值。 任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:0)

Well, the number of possible XPaths is infinite; even the set of XPaths that select non-empty node sets is infinite. So I guess you need to qualify your question. I suspect you are interested in knowing all the paths using the child axis (only) that select at least one element. In XPath 2.0 (ignoring namespace issues) this is

distinct-values(//*/string-join(ancestor-or-self::node()/name(), '/'))