当前位置:网站首页>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
边栏推荐
- datax自检报错 /datax/plugin/reader/._drdsreader/plugin.json]不存在
- GET/POST/PUT/PATCH/DELETE含义
- 位运算异或
- If Jerry needs to send a large package, he needs to modify the MTU on the mobile terminal [article]
- 数字经济时代,如何保障安全?
- navicat如何导入MySQL脚本
- TS 类型体操 之 循环中的键值判断,as 关键字使用
- [dictionary tree] [trie] p3879 [tjoi2010] reading comprehension
- js對象獲取屬性的方法(.和[]方式)
- Simulation of holographic interferogram and phase reconstruction of Fourier transform based on MATLAB
猜你喜欢
Do you really think binary search is easy
Google may return to the Chinese market after the Spring Festival.
剪映的相关介绍
Seriously recommend several machine learning official account
【mysql学习笔记30】锁(非教程)
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
烧录场景下的源代码防泄密方案分享
[online problem processing] how to kill the corresponding process when the MySQL table deadlock is caused by the code
The way to learn go (I) the basic introduction of go to the first HelloWorld
[CF Gym101196-I] Waif Until Dark 网络最大流
随机推荐
Sharing of source code anti disclosure scheme under burning scenario
Jerry's ad series MIDI function description [chapter]
TypeScript 函数定义
剪映的相关介绍
可变参数重载时的内存错误
Apache middleware vulnerability recurrence
Go learning --- use reflection to judge whether the value is valid
TS 类型体操 之 extends,Equal,Alike 使用场景和实现对比
leecode-C語言實現-15. 三數之和------思路待改進版
洛谷P4127 [AHOI2009]同类分布 题解
杰理之开发板上电开机,就可以手机打开 NRF 的 APP【篇】
位运算异或
Compliance and efficiency, accelerate the digital transformation of pharmaceutical enterprises, and create a new document resource center for pharmaceutical enterprises
解决方案:智慧工地智能巡检方案视频监控系统
OpenJudge NOI 2.1 1749:数字方格
Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
【mysql学习笔记30】锁(非教程)
Luogu p4127 [ahoi2009] similar distribution problem solution
[cf gym101196-i] waif until dark network maximum flow
Typescript void base type