send message from string

50 views
Skip to first unread message

Mwu

unread,
Apr 3, 2010, 1:55:37 PM4/3/10
to Strophe
If I have a message as a string rather than an object built up from
strophe's builder class, how would I send that through strophe? I can
get an xml document from the string through the browser's xml document
parsing, but strophe doesn't seem to like it if it's not built with
its own xml builder. Any ideas?

- Marcus

Jack Moffitt

unread,
Apr 3, 2010, 2:13:39 PM4/3/10
to str...@googlegroups.com

You'll need to reparent the XML node I think. I have thought about
exposing a consistent parsing interface in Strophe, but haven't done
so yet.

Look into adoptNode() for reparenting.

jack.

Mwu

unread,
Apr 4, 2010, 7:45:20 AM4/4/10
to Strophe

Thanks! That did the trick. I had no idea that different documents
would be a problem, but it seems kinda obvious that it would now.

Jack Moffitt

unread,
Apr 4, 2010, 12:51:29 PM4/4/10
to str...@googlegroups.com
> Thanks! That did the trick. I had no idea that different documents
> would be a problem, but it seems kinda obvious that it would now.

Some browsers just let you do it anyway or do it for you silently.
Safari in particular seems to be a stickler about it.

It's mostly confusing because most people don't work with XML DOM
much, and very rarely outside of a single document.

jack.

Reply all
Reply to author
Forward
0 new messages