>> English << | česky | Nederlands | Français | Español | По-русски | Deutsch | 中文 | Italiano | Polski ZVON > Tutorials > XPath Tutorial
>> Example 8 << | Prev | Next

Function name() returns name of the element, the starts-with function returns true if the first argument string starts with the second argument string, and the contains function returns true if the first argument string contains the second argument string.
 
//*[name()='BBB']
Select all elements with name BBB, equivalent with //BBB

     <AAA>
          <BCC>
               <BBB/>
               <BBB/>
               <BBB/>
          </BCC>
          <DDB>
               <BBB/>
               <BBB/>
          </DDB>
          <BEC>
               <CCC/>
               <DBD/>
          </BEC>
     </AAA>
Open the example in XLab. | Tree view (JPG)
 
//*[starts-with(name(),'B')]
Select all elements name of which starts with letter B

     <AAA>
          <BCC>
               <BBB/>
               <BBB/>
               <BBB/>
          </BCC>
          <DDB>
               <BBB/>
               <BBB/>
          </DDB>
          <BEC>
               <CCC/>
               <DBD/>
          </BEC>
     </AAA>
Open the example in XLab. | Tree view (JPG)
 
//*[contains(name(),'C')]
Select all elements name of which contain letter C

     <AAA>
          <BCC>
               <BBB/>
               <BBB/>
               <BBB/>
          </BCC>
          <DDB>
               <BBB/>
               <BBB/>
          </DDB>
          <BEC>
               <CCC/>
               <DBD/>
          </BEC>
     </AAA>
Open the example in XLab. | Tree view (JPG)



_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet




Related sites:
  • dotNet Slackers - Your latest resource for ASP.NET
  • Dotnet Spider - Outsourcing and Offshore software development in India
  • XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
  • Planet Source Code - The largest public source code database on the Internet
conference call service VoIP Internettelefonie DSL, SDSL, ADSL answering service