xpath“.//span",点是什么意思?

编程入门 行业动态 更新时间:2024-10-10 05:23:23
本文介绍了xpath“.//span",点是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在//header[.//span[contains(text(), 'part_title')]]//label[contains(@class, 'start')]中,. .// 中的点是什么意思?

In //header[.//span[contains(text(), 'part_title')]]//label[contains(@class, 'start')], what does the . dot in .// mean?

推荐答案

您需要了解 XPath上下文"节点的概念.在导航 XPath 表达式时,每个步骤都会标识一个上下文节点或节点集,从其中计算后续表达式,绝对路径除外,例如 //.

You need to learn about the concept of the XPath "context" node. When navigating an XPath expression, every step identifies a context node or node-set from which the subsequent expression is evaluated, except for absolute paths such as //.

构造 .//span 的意思是从当前节点开始,在当前上下文节点下的任何级别找到下一个后代 span.与 对比./span,表示当前上下文节点的直接子节点 span.

The construction .//span means "starting at the current node find the next descendant span at any level below the current context node. Contrast with ./span, which would mean an immediate child span of the current context node.

没有前导点 /span 表示根节点,如果它是 span,并且 //span 表示第一个 span 在任何级别的文档中.

Without the leading dot /span means the root node if it's a span, and //span means the first span in the document at any level.

或者,更简单地说,前导点与 Linux 目录中的 . 条目具有完全相同的含义.

Or, to put it more simply, the leading dot has exactly the same meaning as the . entry in a Linux directory.

更多推荐

xpath“.//span",点是什么意思?

本文发布于:2023-06-03 09:49:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/471187.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:xpath   span   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!