Sample code for 30+ languages & platforms
Go

SearchAllForContent

See more XML Examples

Demonstrates the SearchAllForContent method.

Chilkat Go Downloads

Go
    success := false

    xml := chilkat.NewXml()
    // xBeginAfter is a Xml
    // xFound is a Xml

    success = xml.LoadXmlFile("qa_data/xml/pigs.xml")
    if success != true {
        fmt.Println(xml.LastErrorText())
        xml.DisposeXml()
        return
    }

    xBeginAfter := xml.GetSelf()
    xFound := xml.SearchAllForContent(xBeginAfter,"*pig*")
    searchForMore := true
    for (searchForMore == true) {

        fmt.Println(xFound.Tag())
        fmt.Println(xFound.Content())
        fmt.Println("--")

        xBeginAfter.DisposeXml()
        xBeginAfter = xFound
        xFound = xml.SearchAllForContent(xBeginAfter,"*pig*")

        searchForMore = xml.LastMethodSuccess()
    }

    xBeginAfter.DisposeXml()

    xml.DisposeXml()