惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Help Net Security
Help Net Security
P
Proofpoint News Feed
J
Java Code Geeks
爱范儿
爱范儿
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
Google DeepMind News
Google DeepMind News
H
Help Net Security
G
Google Developers Blog
Jina AI
Jina AI
Vercel News
Vercel News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
Lohrmann on Cybersecurity
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
GbyAI
GbyAI
B
Blog
O
OpenAI News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Y
Y Combinator Blog
C
Cisco Blogs
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
AI
AI
W
WeLiveSecurity
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale

博客园 - Jonny Yu

[GCC学习]get the optimized function call graph 界面开发中的那些疯狂的小事 Re:架构设计之性能设计经验 技术资产管理 .Net下进程外COM服务器的实现 控件的鼠标拖动和改变大小实现的思考 Learn from mistake, i.e. 和 e.g. 是不同的 How can I hide a user from the Welcome Screen in Windows XP? About HDC window class, OO about wParam and lParam 就差一点点-微妙的强制类型转换 [GDI+]DrawRectangle和FillRectangle,细节决定成败 Disable the CrossThreadChecking in .Net Framework v2.0 several useful Store Procedures in MSSQL http://cnblogs.com/rickie/archive/2005/07/02/184927.aspx VS2005使用体验 Inventor 的一些快捷键 First day in Hanna.
XPath crash course note
Jonny Yu · 2005-03-08 · via 博客园 - Jonny Yu

XPath language

What is XPath?
[To be supplied.]

What is XPath for?
[To be supplied.]

Why XPath?
[To be supplied.]

basic concepts & examples:
/ 根路径
//  相对路径,表示选择文档中所有满足双斜线//之后规则的元素(无论层级关系)
* 代表任意元素 ,
/AAA/BBB/* 表示在AAA元素的BBB子元素下一层的所有元素
/*/*/BBB 在第三层出现的所有BBB元素
//* 所有元素

[1] 进一步指定访问元素,这里是按索引,下标由1开始 ,last()表示最后一个元素

@id id属性名限定, //@id 表示选择所有含有id属性的元素, id可以用*代表,表示任意一个非空字串。
//BBB[@id] 匹配所有含有id属性的BBB元素

not()函数取非, not(@*), 所有不含属性

@id='value' 限定id的值为value

事实上@id本身应该就是表示取值了。

normalize-space(@name)='bbb', 在trim掉值首尾的空格后与'bbb'进行比较。
//*[count(BBB)=2] 选择那些包含2个BBB的子元素的元素
//*[count(*)=2]  选择那些包含两个子元素的元素

name()返回元素名称
//*[name()='BBB'] 按名称查找,这个似乎等价于//BBB ?

start-with(),函数共有两个参数,第一个参数是所判断的字符串,第二个是要求的起始字符串,如果匹配则返回true
//*[start-with(name(),'start'] 选择所有元素名以start开头的元素

contains(), 两个参数,第一个包含第二个时返回true
//*[contains(name(),'middle'] 选择所有元素名包含middle的元素

string-length()返回指定字符串的长度,
//*[string-length(name()) &lt 3 ] &lt替代<, &gt 替代>