Here are some examples of patterns:
-
paramatches anyparaelement -
*matches any element -
chapter|appendixmatches anychapterelement and anyappendixelement -
olist/itemmatches anyitemelement with anolistparent -
appendix//paramatches anyparaelement with anappendixancestor element -
/matches the root node -
text()matches any text node -
processing-instruction()matches any processing instruction -
node()matches any node other than an attribute node and the root node -
id("W11")matches the element with unique IDW11 -
para[1]matches anyparaelement that is the firstparachild element of its parent -
*[position()=1 and self::para]matches anyparaelement that is the first child element of its parent -
para[last()=1]matches anyparaelement that is the onlyparachild element of its parent -
items/item[position()>1]matches anyitemelement that has aitemsparent and that is not the firstitemchild of its parent -
item[position() mod 2 = 1]would be true for anyitemelement that is an odd-numbereditemchild of its parent. -
div[@class="appendix"]//pmatches anypelement with adivancestor element that has aclassattribute with valueappendix -
@classmatches anyclassattribute (not any element that has aclassattribute) -
@*matches any attribute
1170

被折叠的 条评论
为什么被折叠?



