📅  最后修改于: 2020-11-09 05:40:02             🧑  作者: Mango
谓词是指用方括号括起来的XPath表达式。它指的是出于某些条件限制节点集中的选定节点。例如,
S.No. | Predicate & Description |
---|---|
1 |
/class/student[1] Select first student element which is child of the class element. |
2 |
/class/student[last()] Select last student element which is child of the class element. |
3 |
/class/student[@rolllno = 493] Select student element with rollno 493. |
4 |
/class/student[marks>85] Select student element with marks > 85. |
本示例通过遍历每个学生来创建带有其详细信息的
Dinkar
Kad
Dinkar
85
Vaneet
Gupta
Vinni
95
Jasvir
Singh
Jazz
90
Students
Roll No
First Name
Last Name
Nick Name
Marks