当前位置:网站首页>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含义
- [MySQL learning notes 30] lock (non tutorial)
- 杰理之AD 系列 MIDI 功能说明【篇】
- Three no resumes in the software testing industry. What does the enterprise use to recruit you? Shichendahai's resume
- 1015 reversible primes (20 points) prime d-ary
- Detailed explanation | detailed explanation of internal mechanism of industrial robot
- leecode-C語言實現-15. 三數之和------思路待改進版
- word怎么只删除英语保留汉语或删除汉语保留英文
- PHP Coding Standard
- How Navicat imports MySQL scripts
猜你喜欢

Redis builds clusters

opencv学习笔记九--背景建模+光流估计

杰理之AD 系列 MIDI 功能说明【篇】

合规、高效,加快药企数字化转型,全新打造药企文档资源中心

Relevant introduction of clip image

Apache middleware vulnerability recurrence

数字经济时代,如何保障安全?

Fundamentals of C language 9: Functions

Leecode-c language implementation -15 Sum of three ----- ideas to be improved

成为优秀的TS体操高手 之 TS 类型体操前置知识储备
随机推荐
word中把带有某个符号的行全部选中,更改为标题
Redis builds clusters
【线上问题处理】因代码造成mysql表死锁的问题,如何杀掉对应的进程
Ble of Jerry [chapter]
edge浏览器 路径获得
C语言 简单易懂的高精度加法
[window] when the Microsoft Store is deleted locally, how to reinstall it in three steps
Typescript indexable type
Luogu p1836 number page solution
The way to learn go (II) basic types, variables and constants
实现精细化生产, MES、APS、ERP必不可少
[MySQL learning notes 32] mvcc
[dictionary tree] [trie] p3879 [tjoi2010] reading comprehension
智能终端设备加密防护的意义和措施
Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
Cf1036c class numbers solution
Typescript void base type
Bit operation XOR
qt颜色与字符串、uint相互转换
超级浏览器是指纹浏览器吗?怎样选择一款好的超级浏览器?