The path to a node is the trail of QNames of the child relationships to get to the node.
节点的路径是要到达节点的子关系的qname的轨迹。

If the root node contains only one child called ‘one’ in namespace ‘example’, and this node has a child called ‘two’ in namespace ‘example’, the nodes in the repository can be identified by:
如果根节点仅包含命名空间“example”中名为“one”的子节点,并且此节点在命名空间“example”中名为“two”的子节点,则存储库中的节点可以通过以下方式标识:

  • ‘/‘
  • ‘/example:one’ (a node specified by a child association ‘example:one’ from the root node)
  • ‘/example:one/example:two’ (a node specified by a child association ‘example:one’ from the root node, and then ‘example:two’ from this node.)

This is very similar to attribute names and how they are specified in XPath.
这与XPath中的属性名及其指定方式非常相似。

There is a special PATH field available to support queries against P.
有一个特殊的路径字段可用于支持对P的查询。

Path queries support a subset of XPATH with the following axes:
路径查询支持具有以下轴的XPATH子集:

  • child
  • descendant-or-self
  • self

It supports the following node tests:

  • name ‘name’
  • namespace qualified name ‘prefix:name’
  • ‘*’ character
  • namespace pattern ‘prefix:*’

You can not find all nodes regardless of namespace; ‘*:woof’ is invalid.
无论命名空间如何,都找不到所有节点; ‘*:woof’ 无效。

It supports the standard abbreviations:
它支持标准缩写:

  • . (self::node())
  • // (descendant-or-self::node())

If omitted, the default aspect is ‘child::’.
如果省略,则默认切面为“child::”。

Predicates are not supported.
不支持判断式。

To find all nodes directly beneath the root node:
要查找根节点正下方的所有节点:

PATH:'/*'

To find all nodes directly beneath the root node in the ‘sys’ namespace:
要查找“sys”命名空间中根节点正下方的所有节点:

PATH:'/sys:*'

To find all node directly beneath the root node in the ‘sys’ namespace and with local name ‘user’:
要在“sys”命名空间中的根节点正下方查找本地名称为“user”的所有节点:

PATH:'/sys:user'

To find all nodes directly below ‘/sys:user’:
要查找’/sys:user’正下方的所有节点:

PATH:'/sys:user/*'

To find all nodes at any depth below ‘/sys:user’:
要查找’/sys:user’下任意深度的所有节点:

PATH:'/sys:user//*'

To find all nodes at any depth below ‘/sys:user’ including the node ‘/sys:user’:
要查找“/sys:user”下任意深度的所有节点,包括节点“/sys:user”:

PATH:'/sys:user//.'

To find the all nodes with QName ‘sys:user’ anywhere in the repository:
要在存储库中的任意位置查找QName为“sys:user”的所有节点:

PATH:'//sys:user'

To find all the children of all the all nodes with QName ‘sys:user’ anywhere in the repository:
要在存储库中的任意位置查找QName为“sys:user”的所有节点下的所有子节点:

PATH:'//sys:user//*'

Important: If you have a large repository, increase the cache sizes to reflect common PATH queries. If not, your queries may be slower than expected.
重要提示:如果您有一个大型存储库,请增加缓存大小以匹配通用路径查询。否则,查询速度可能会比预期的慢。

文档更新时间: 2020-02-10 20:34   作者:凌云文档