這是從XMPP服務器端發送的XML,我想要收到,以便我可以將它發送到我的XML解析器。當使用android的asmack XMPP庫時,無法從消息TAG讀取自定義屬性?
<message to="[email protected]/smack" chat_id="73392"
custom_packet="true" user_id="44" manager_id="39" time_stamp="0" website_id="0"
visitor_name="John" end_time="False" xml:lang="en-us" type="groupchat"
from="[email protected]/39">
<body>Hello</body>
<x xmlns="http://jabber.org/protocol/muc#user">
<status xmlns="" code="0"/>
</x></message>
這是一個示例XML,我收到。 當我使用p.toXML(); // Packet p
<message to="[email protected]/Smack"
from="[email protected]/Visitor1171" type="groupchat">
<body>Hello</body>
<delay xmlns="urn:xmpp:delay"></delay>
<x xmlns="jabber:x:delay" stamp="20120917T05:57:19"
from="[email protected]/4732abb5">
</x></message>
我剛剛開始使用XMPP服務器。因此,任何指導意見都將得到讚賞。
永遠不要爲XMPP頂級元素創建自己的屬性。另見[XEP-134 2.1](http://xmpp.org/extensions/xep-0134.html#xmpp)。而是添加一個擴展名' / myextension>' –
Flow