(C) SearchAllForContent
Demonstrates the SearchAllForContent method.
#include <C_CkXml.h>
void ChilkatSample(void)
{
HCkXml xml;
HCkXml xBeginAfter;
HCkXml xFound;
BOOL success;
BOOL searchForMore;
xml = CkXml_Create();
success = CkXml_LoadXmlFile(xml,"qa_data/xml/pigs.xml");
if (success != TRUE) {
printf("%s\n",CkXml_lastErrorText(xml));
CkXml_Dispose(xml);
return;
}
xBeginAfter = CkXml_GetSelf(xml);
xFound = CkXml_SearchAllForContent(xml,xBeginAfter,"*pig*");
searchForMore = TRUE;
while ((searchForMore == TRUE)) {
printf("%s\n",CkXml_tag(xFound));
printf("%s\n",CkXml_content(xFound));
printf("--\n");
CkXml_Dispose(xBeginAfter);
xBeginAfter = xFound;
xFound = CkXml_SearchAllForContent(xml,xBeginAfter,"*pig*");
searchForMore = CkXml_getLastMethodSuccess(xml);
}
CkXml_Dispose(xBeginAfter);
CkXml_Dispose(xml);
}
|