7. name() :
//*[name()='BBB']
<AAA>
<BCC>
<BBB/>
<BBB/>
<BBB/>
BCC>
<DDB>
<BBB/>
<BBB/>
DDB>
<BEC>
<CCC/>
<DBD/>
BEC>
AAA>
//*[starts-with(name(),'B')]
<AAA>
<BCC>
<BBB/>
<BBB/>
<BBB/>
BCC>
<DDB>
<BBB/>
<BBB/>
DDB>
<BEC>
<CCC/>
<DBD/>
BEC>
AAA>
//*[contains(name(),'C')]
<AAA>
<BCC>
<BBB/>
<BBB/>
<BBB/>
BCC>
<DDB>
<BBB/>
<BBB/>
DDB>
<BEC>
<CCC/>
<DBD/>
BEC>
AAA>
8. string-length() :
//*[string-length(name()) = 3]
<AAA>
<Q/>
<SSSS/>
<BB/>
<CCC/>
<DDDDDDDD/>
<EEEE/>
AAA>
//*[string-length(name()) < 3]
<AAA>
<Q/>
<SSSS/>
<BB/>
<CCC/>
<DDDDDDDD/>
<EEEE/>
AAA>
//*[string-length(name()) > 3]
<AAA>
<Q/>
<SSSS/>
<BB/>
<CCC/>
<DDDDDDDD/>
<EEEE/>
AAA>
9. "|" :
//CCC | //BBB
<AAA>
<BBB/>
<CCC/>
<DDD>
<CCC/>
DDD>
<EEE/>
AAA>
/AAA/EEE | //BBB
<AAA>
<BBB/>
<CCC/>
<DDD>
<CCC/>
DDD>
<EEE/>
AAA>
/AAA/EEE | //DDD/CCC | /AAA | //BBB
<AAA>
<BBB/>
<CCC/>
<DDD>
<CCC/>
DDD>
<EEE/>
AAA>
本文转自 netcorner 博客园博客,原文链接:http://www.cnblogs.com/netcorner/archive/2006/11/09/2912522.html ,如需转载请自行联系原作者