0

I am trying to build an XML XMPP Stanza using Strophe JS. I want to add XML Attribute like this :

  <message xmlns:cli="jabber:client"  cli:subject="TEXT MESSAGE" cli:lang="en"> </message>

Note that it has cli:subject="TEXT MESSAGE"

How do I achieve this ?

My code is :

var mymessge = $msg({
                              to: '[email protected]/primea',
                              from: '[email protected]/primea',
                              type: "chat",
                              id: "cloud_1565005747735"}).attrs({cli:({subject:"TEXT MESSAGE"})}).c('body').t("Hello World Rajan ").up().c("request", {
                              xmlns: "urn:xmpp:receipts" });
 connection.send(mymessge);   

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.