React Native
React Native
SearchAllForContent
See more XML Examples
Demonstrates the SearchAllForContent method.Chilkat React Native Downloads
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;
}
}