当前位置:网站首页>Position() function in XPath uses
Position() function in XPath uses
2022-07-06 07:37:00 【Sub Archaean hyperevolution】
Just want to get a few of the elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>welcome to my index</title>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
</ul>
</body>
</html>
How to get the third to sixth li label
//ul/li[position()>2][position()<5]
//position() Position in variable [2] Inside
Find time li The label is greater than two , Start with the third one , Then find four more li label
I have seen many people explain position() function , But I didn't say how this matched , My current understanding is like this .
Explain it. :
position()>2 It means to start from the third element
position()<5 It means take 4 Elements
So the combination of these two is to take the third and sixth labels
边栏推荐
- Get/post/put/patch/delete meaning
- 杰理之开发板上电开机,就可以手机打开 NRF 的 APP【篇】
- Scala语言学习-08-抽象类
- navicat如何导入MySQL脚本
- The difference between TS Gymnastics (cross operation) and interface inheritance
- Bit operation XOR
- Methods for JS object to obtain attributes (. And [] methods)
- 解决方案:智慧工地智能巡检方案视频监控系统
- leecode-C語言實現-15. 三數之和------思路待改進版
- 杰理之BLE【篇】
猜你喜欢
数字经济时代,如何保障安全?
[window] when the Microsoft Store is deleted locally, how to reinstall it in three steps
QT color is converted to string and uint
软件测试界的三无简历,企业拿什么来招聘你,石沉大海的简历
TS 类型体操 之 extends,Equal,Alike 使用场景和实现对比
How Navicat imports MySQL scripts
In the era of digital economy, how to ensure security?
【线上问题处理】因代码造成mysql表死锁的问题,如何杀掉对应的进程
Mise en œuvre du langage leecode - C - 15. Somme des trois chiffres - - - - - idées à améliorer
Go learning -- implementing generics based on reflection and empty interfaces
随机推荐
Simple and understandable high-precision addition in C language
Cf1036c class numbers solution
杰理之需要修改 gatt 的 profile 定义【篇】
TypeScript 接口属性
Ble of Jerry [chapter]
Set picture annotation in markdown
TypeScript void 基础类型
How MySQL merges data
The way to learn go (I) the basic introduction of go to the first HelloWorld
Simulation of holographic interferogram and phase reconstruction of Fourier transform based on MATLAB
Go learning --- use reflection to judge whether the value is valid
解决方案:智慧工地智能巡檢方案視頻監控系統
C # display the list control, select the file to obtain the file path and filter the file extension, and RichTextBox displays the data
After the hot update of uniapp, "mismatched versions may cause application exceptions" causes and Solutions
[MySQL learning notes 30] lock (non tutorial)
杰理之AD 系列 MIDI 功能说明【篇】
链表面试题(图文详解)
Typescript function definition
OpenJudge NOI 2.1 1661:Bomb Game
leecode-C語言實現-15. 三數之和------思路待改進版