私はstropheライブラリの使用法を学び始めています.addHandlerを使用して応答を解析すると、xml応答の最初のノードのみを読み取るように見えるので、そのようなxmlを受け取ると:
<body xmlns='http://jabber.org/protocol/httpbind'>
<presence xmlns='jabber:client' from='test2@localhost' to='test2@localhost' type='avaliable' id='5593:sendIQ'>
<status/>
</presence>
<presence xmlns='jabber:client' from='test@localhost' to='test2@localhost' xml:lang='en'>
<status />
</presence>
<iq xmlns='jabber:client' from='test2@localhost' to='test2@localhost' type='result'>
<query xmlns='jabber:iq:roster'>
<item subscription='both' name='test' jid='test@localhost'>
<group>test group</group>
</item>
</query>
</iq>
</body>
ハンドラ testHandler をそのように使用すると:
connection.addHandler(testHandler,null,"presence");
function testHandler(stanza){
console.log(stanza);
}
ログのみ:
<presence xmlns='jabber:client' from='test2@localhost' to='test2@localhost' type='avaliable' id='5593:sendIQ'>
<status/>
</presence>
私は何が欠けていますか?それは正しい行動ですか?他のスタンザを取得するには、ハンドラーを追加する必要がありますか? 前もってありがとう