Sample code for 30+ languages & platforms
Visual FoxPro

SearchAllForContent

See more XML Examples

Demonstrates the SearchAllForContent method.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loXml
LOCAL loXBeginAfter
LOCAL loXFound
LOCAL lnSearchForMore

lnSuccess = 0

loXml = CreateObject('Chilkat.Xml')

lnSuccess = loXml.LoadXmlFile("qa_data/xml/pigs.xml")
IF (lnSuccess <> 1) THEN
    ? loXml.LastErrorText
    RELEASE loXml
    CANCEL
ENDIF

loXBeginAfter = loXml.GetSelf()
loXFound = loXml.SearchAllForContent(loXBeginAfter,"*pig*")
lnSearchForMore = 1
DO WHILE (lnSearchForMore = 1)

    ? loXFound.Tag
    ? loXFound.Content
    ? "--"

    RELEASE loXBeginAfter
    loXBeginAfter = loXFound
    loXFound = loXml.SearchAllForContent(loXBeginAfter,"*pig*")

    lnSearchForMore = loXml.LastMethodSuccess
ENDDO

RELEASE loXBeginAfter

RELEASE loXml