Hi,
I would like to develop an XMPP component with a java library to connect with ejabberd.
I tried:
- smack but it is only for clients (not components) and
- Yaja! but the last release is old (2003) and there is a bug in the dom4j library (used by Yaja!). I can't create an XMPP packet and I can't expect a fix, these two projects are down.
Hi,
Maybe I'm expecting too much from Dom4j, but this code
generates invalid XML code:
Document document=DocumentHelper.createDocument();
Element root = document.addElement( "root" );
Element author1 = root.addElement( "test" )
.addCDATA( "Some ]]> Text" );
System.out.println(document.asXML());
Output given:
<?xml version="1.0" encoding="UTF-8"?>
Text]]>
I would have expected, at least, an error when adding
the CDATA, or some kind of escaping to avoid the wrong
output.
Thanks anyway for the great soft!
I need some help to find a java library which helps me to develop my XMPP component.
I heard something about Whack library but I can't find the website.
Thanks for your help.
Yougouff
EDIT: Finally, I deleted the bad code and sent the packet.
String stanza_string = stanza.asXML();
stanza_string = stanza_string.replace("<![CDATA[", "");
stanza_string = stanza_string.replace("]]>", "");
getSession().write( stanza_string );
I found whack repository but there is no documentation with it.