Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
skhanna #1
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
Subject: Serialize XMPP xml stanza in class object
Hi Alex,

I am using Matrix JS library for XMPP client. I have different XMPP message stanza received in Matrix JS client. I want to parse received xml xmpp stanza in different class object using type script. Is there any utility available in matrix Js

Thanks,
Sanjeev
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The magic happens here in the Factory:
https://github.com/agnauck/matrix-js/blob/master/Library/X…

for all classes which are registered there it builds the typescript object on serialization automatically, otherwise its returns you a XmppXElement object.

So just study the code I linked above, build your own typescript classes and register them in the Factory.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: