Javascript 如何使用Stophe在XML消息中添加元素
我正在使用 我想在messagexml标记中添加元素 Strophe链接: 我的代码是:Javascript 如何使用Stophe在XML消息中添加元素,javascript,xml,xmpp,strophe,Javascript,Xml,Xmpp,Strophe,我正在使用 我想在messagexml标记中添加元素 Strophe链接: 我的代码是: connection.sendIQ($iq({type: "get"}).c("query", {xmlns: Strophe.NS.ROSTER}).tree(), onRoster); connection.send( $msg( { to:"user1@rtm.umobility
connection.sendIQ($iq({type: "get"}).c("query", {xmlns: Strophe.NS.ROSTER}).tree(), onRoster);
connection.send(
$msg(
{
to:"user1@rtm.umobility.bizrtc/primea",
id:"user2_1564828681632",
from:"user2@rtm.umobility.bizrtc/primea",
}
)
);
这将生成以下XML:
<message from="user2@rtm.umobility.bizrtc/primea" id="user2_1564828681632" to="user1@rtm.umobility.bizrtc/primea" xmlns="jabber:client"/>
我需要这样的东西:
<message xmlns:cli="jabber:client" to="cinu@rtm.umobility.bizrtc" cli:subject="TEXT MESSAGE" cli:lang="en" type="chat" id="rajan_1564637142811" from="rajan@rtm.umobility.bizrtc/primea"><body>Some XMPP Message</body><request xmlns="urn:xmpp:receipts"></request></message>
一些XMPP消息
在上面的XML中,它在
标记内有
标记。我该怎么做?我想用Stophe JS做这件事。发送XMPP消息