Sample code for 30+ languages & platforms
VB.NET

SearchAllForContent

See more XML Examples

Demonstrates the SearchAllForContent method.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

Dim xml As New Chilkat.Xml
Dim xBeginAfter As Chilkat.Xml
Dim xFound As Chilkat.Xml

success = xml.LoadXmlFile("qa_data/xml/pigs.xml")
If (success <> True) Then
    Debug.WriteLine(xml.LastErrorText)
    Exit Sub
End If


xBeginAfter = xml.GetSelf()
xFound = xml.SearchAllForContent(xBeginAfter,"*pig*")
Dim searchForMore As Boolean = True
While (searchForMore = True)

    Debug.WriteLine(xFound.Tag)
    Debug.WriteLine(xFound.Content)
    Debug.WriteLine("--")


    xBeginAfter = xFound
    xFound = xml.SearchAllForContent(xBeginAfter,"*pig*")

    searchForMore = xml.LastMethodSuccess
End While