如何使用Swift3解析XMPPFramework中的xmppMessage元素,属性和节点?

时间:2017-05-25 05:23:43

标签: ios iphone xcode swift3 xmppframework

 func xmppStream(_ sender: XMPPStream!, didReceive message: XMPPMessage!){
print(message)
}

结果类似于以下格式,

<message xmlns="jabber:client" from="pubsub.mynet.com" to="002225743@mynet.com" type="headline">
    <event xmlns="http://jabber.org/protocol/pubsub#event">
        <items type="headline" node="mynet.global">
            <item id="1495526003">
                <xml>
                    <title>My Net</title>
                    <about>Good for you!</about>
                    <published>2017-05-23 14:23:23</published>
                </xml>
            </item>
        </items>
    </event>
    <delay xmlns="urn:xmpp:delay" from="admin@mynet.com/jaxl#5022c770097cfbce285d9564a960f9c7" stamp="2017-05-23T07:53:23Z"/>
</message>

如何在<about>中获取<xml>。如果有人有答案和想法,请帮我解决问题。

0 个答案:

没有答案