Sample code for 30+ languages & platforms
React Native

SearchAllForContent

See more XML Examples

Demonstrates the SearchAllForContent method.

Chilkat React Native Downloads

React Native
import { Xml } from '@chilkat/react-native'

function chilkatExample() {
  const xml = new Xml();

  try {
    xml.loadXmlFile('qa_data/xml/pigs.xml');
  } catch {
    console.log(xml.lastErrorText);
    return;
  }

  let xBeginAfter = xml.getSelf();
  let xFound = xml.searchAllForContent('*pig*', xBeginAfter);
  let searchForMore = true;
  while (searchForMore) {

    console.log(xFound.tag);
    console.log(xFound.content);
    console.log('--');

    xBeginAfter = xFound;
    xFound = xml.searchAllForContent('*pig*', xBeginAfter);

    searchForMore = xml.lastMethodSuccess;
  }
}