powered by Jive Software

Smack PacketExtension

Hi all.

*I am extending majiic

messages using Smack

library, and I have got a doubt. Maybe,

you can help me.*

*I can perfectly add an

extension for a packet and recognize them (using

FilterListener class).*

*For example, the Presence


Presence my_message = new Presence();


PacketExtension my_extension = new PacketExtension(“x”, “http://my_page.es”);



*JID receive this message and is able to show the XML text of

this message:*

String xmlText = packet.toXML();



<x xmlns=“http://my_page.es”/>


*I am be able to add values (

<name>value</name>) to extension but we have got troubles with the


*how can we add attributes inside extension?. I mean, I

want to send this xml text after adding the extension:*




<x xmlns=“http://my_page.es”>

+<item name=“DIR”




and JID receives this xml text:

++"<presence …> <b

+++<x xmlns="urn:int:nato:majiic:xmpp:e




*You can see

that JID is be able to recognize my extension and the +item+ label, but

the next text disappear: +name=“DIR”

version=“0.12”+. Only the label arrives.*

Can you help us?

Thanks you very much.