天天看點

XPath基礎文法(2)

< DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd>

7. name() :

//*[name()='BBB']

     <AAA>

          <BCC>

               <BBB/>

          BCC>

          <DDB>

          DDB>

          <BEC>

               <CCC/>

               <DBD/>

          BEC>

     AAA>

//*[starts-with(name(),'B')]

//*[contains(name(),'C')]

8. string-length() :

//*[string-length(name()) = 3]

          <Q/>

          <SSSS/>

          <BB/>

          <CCC/>

          <DDDDDDDD/>

          <EEEE/>

//*[string-length(name()) < 3]

//*[string-length(name()) > 3]

9. "|" :

//CCC | //BBB

          <BBB/>

          <DDD>

          DDD>

          <EEE/>

/AAA/EEE | //BBB

/AAA/EEE | //DDD/CCC | /AAA | //BBB

本文轉自 netcorner 部落格園部落格,原文連結:http://www.cnblogs.com/netcorner/archive/2006/11/09/2912522.html  ,如需轉載請自行聯系原作者

繼續閱讀