Sample code for 30+ languages & platforms
C#

SearchAllForContent

See more XML Examples

Demonstrates the SearchAllForContent method.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.Xml xml = new Chilkat.Xml();
Chilkat.Xml xBeginAfter = null;
Chilkat.Xml xFound = null;

success = xml.LoadXmlFile("qa_data/xml/pigs.xml");
if (success != true) {
    Debug.WriteLine(xml.LastErrorText);
    return;
}

xBeginAfter = xml.GetSelf();
xFound = xml.SearchAllForContent(xBeginAfter,"*pig*");
bool searchForMore = true;
while ((searchForMore == true)) {

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

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

    searchForMore = xml.LastMethodSuccess;
}