Sample code for 30+ languages & platforms
Lua

SearchAllForContent

See more XML Examples

Demonstrates the SearchAllForContent method.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

local xml = chilkat.Xml.new()

local success = xml:load_xml_file("qa_data/xml/pigs.xml")
if not success then
    print(xml.last_error_text)
    return
end

local xBeginAfter = xml:get_self()
local xFound = xml:search_all_for_content(xBeginAfter, "*pig*")
local searchForMore = true
while searchForMore do
    print(xFound.tag)
    print(xFound.content)
    print("--")

    xBeginAfter = xFound
    xFound = xml:search_all_for_content(xBeginAfter, "*pig*")

    searchForMore = xml.last_method_success
end