XML Parsing Problem

I’m trying to parse a small bit of XML and it isn’t working.

xml.ifXMLElement.getName()

gives an error message stating “Member function not found in BrightScript Component or interface”. And

xml.ifXMLElement.getText()

prints an empty string. Right now I’ve got the XML packaged in the application so here’s my code to parse the XML:


Function getFeed() As Object
    print "Attempting to get the feed"
    xmlText = readAsciiFile("pkg:/xml/content.xml")
    print "The text is " ; xmlText
    xml = createObject("roXMLElement")
    if not xml.parse(xmlText)
        print "Cannot parse the feed"
        return invalid
    endif
    print "The xml is of type "; type(xml)

    print "Name of xml is " ; xml.ifXMLElement.getName()
End Function

It reads the text from the file with no problems and xml.parse() returns true but nothing else seems to work.

The test XML I’m trying to parse is:


<tag>
    <other>stuff</other>
</tag>

I know I’m probably making a stupid mistake but I’d be grateful for any help.

Try it without the ifXMLElement part…

xml.GetName() ' should return "tag"
xml.other[0].GetName() ' should return "other"
xml.other[0].GetText() ' should return "stuff"