XMPP uses some odd styling, for example:
<stream:stream to='domain.com' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
When calling parse.()
on this XML data, it returns false
. There are 2 problems that I could see be causing this:
- Does not have
</stream>
tag <stream:stream
contains a semi colon.
Can NSXMLParser be used to parse this? On GitHub, I saw other people built their own parser, but I don't think it will be as accurate as NSXMLParser provided, if it worked.
It can be parsed by NSXMLParser as the NSXMLParser conforms to NSXMLParserDelegate protocol which implements certain callback delegate methods such as
and
which allows you to parse when the parser encounters opening/closing tags.
Colon ':' inside the tag might not stop you from what you want to achieve. And you doesn't have to worry about missing closing tag as by then you will be responding to didStartElement callback method only