Home
MatriX vNext
MatriX XMPP SDK ▼
Forum
About us ▼
Contact
Not logged in.
·
Lost password
·
Register
Forum
Search
Members
Forum:
agsXMPP
Convert XML to Message
js629AC
2013-10-08, 22:51
#1
Member since Oct 2013 ·
4
posts
Group memberships:
Members
Show profile
·
Link to this post
Subject:
Convert XML to Message
I was wondering how I would go about converting some XML to a message?
Alex
2013-10-08, 22:57
#2
Member since Feb 2003 ·
4447
posts · Location: Germany
Group memberships:
Administrators, Members
Show profile
·
Link to this post
see:
http://forum.ag-software.net/thread/842-Send-Test-XML-Mess…
js629AC
2013-10-08, 23:08
#3
Member since Oct 2013 ·
4
posts
Group memberships:
Members
Show profile
·
Link to this post
Thanks for the quick response Alex, but can you expand on this 'You can use the LoadXml member of Element which parses and loads the Xml.' a little bit?
I can't seem to find element.loadxml.
js629AC
2013-10-09, 00:07
#4
Member since Oct 2013 ·
4
posts
Group memberships:
Members
Show profile
·
Link to this post
agsXMPP.Xml.Dom.Document d = new agsXMPP.Xml.Dom.Document();
d.LoadXml(message);
Message msg = new Message();
msg = d as Message();
What am I doing wrong here?
Alex
2013-10-09, 08:34
#5
Member since Feb 2003 ·
4447
posts · Location: Germany
Group memberships:
Administrators, Members
Show profile
·
Link to this post
try:
string
xml
=
"<message xmlns='jabber:client'><body>Hello World</body></message>"
;
var
msg
=
Element
.
LoadXml
(
xml
)
as
Message
;
js629AC
2013-10-09, 16:43
#6
Member since Oct 2013 ·
4
posts
Group memberships:
Members
Show profile
·
Link to this post
This is what I found to work last night:
agsXMPP
.
Xml
.
Dom
.
Document
d
=
new
agsXMPP
.
Xml
.
Dom
.
Document
(
)
;
d
.
LoadXml
(
decryptedmessage
)
;
var
msg
=
d
.
RootElement
as
agsXMPP
.
protocol
.
client
.
Message
;
Thanks for your help Alex.
This post was edited
2
times, last on 2013-10-09, 16:45 by
Alex
.
Close
Smaller –
Larger +
Reply to this post:
Verification code:
Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys:
Special characters:
Forum:
agsXMPP