(PureBasic) SearchAllForContent
Demonstrates the SearchAllForContent method.
IncludeFile "CkXml.pb"
Procedure ChilkatExample()
xml.i = CkXml::ckCreate()
If xml.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
xBeginAfter.i
xFound.i
success.i = CkXml::ckLoadXmlFile(xml,"qa_data/xml/pigs.xml")
If success <> 1
Debug CkXml::ckLastErrorText(xml)
CkXml::ckDispose(xml)
ProcedureReturn
EndIf
xBeginAfter = CkXml::ckGetSelf(xml)
xFound = CkXml::ckSearchAllForContent(xml,xBeginAfter,"*pig*")
searchForMore.i = 1
While (searchForMore = 1)
Debug CkXml::ckTag(xFound)
Debug CkXml::ckContent(xFound)
Debug "--"
CkXml::ckDispose(xBeginAfter)
xBeginAfter = xFound
xFound = CkXml::ckSearchAllForContent(xml,xBeginAfter,"*pig*")
searchForMore = CkXml::ckLastMethodSuccess(xml)
Wend
CkXml::ckDispose(xBeginAfter)
CkXml::ckDispose(xml)
ProcedureReturn
EndProcedure
|