Unicode C
Unicode C
SearchAllForContent
See more XML Examples
Demonstrates the SearchAllForContent method.Chilkat Unicode C Downloads
#include <C_CkXmlW.h>
void ChilkatSample(void)
{
BOOL success;
HCkXmlW xml;
HCkXmlW xBeginAfter;
HCkXmlW xFound;
BOOL searchForMore;
success = FALSE;
xml = CkXmlW_Create();
success = CkXmlW_LoadXmlFile(xml,L"qa_data/xml/pigs.xml");
if (success != TRUE) {
wprintf(L"%s\n",CkXmlW_lastErrorText(xml));
CkXmlW_Dispose(xml);
return;
}
xBeginAfter = CkXmlW_GetSelf(xml);
xFound = CkXmlW_SearchAllForContent(xml,xBeginAfter,L"*pig*");
searchForMore = TRUE;
while ((searchForMore == TRUE)) {
wprintf(L"%s\n",CkXmlW_tag(xFound));
wprintf(L"%s\n",CkXmlW_content(xFound));
wprintf(L"--\n");
CkXmlW_Dispose(xBeginAfter);
xBeginAfter = xFound;
xFound = CkXmlW_SearchAllForContent(xml,xBeginAfter,L"*pig*");
searchForMore = CkXmlW_getLastMethodSuccess(xml);
}
CkXmlW_Dispose(xBeginAfter);
CkXmlW_Dispose(xml);
}