powered by Jive Software

IQ extensibility + Pubsub

Hi,

I’'m using the smack API to develop the functionality for a pubsub client and have a problem with the parsing of the following incoming xml stanza:

<iq to=’‘Rachel@localhost/Smack’’ from=’‘pubsub.localhost’’ id=’‘5w48h-4’’ type=’‘result’’>

<query xmlns=’‘http://jabber.org/protocol/disco#info’’ node=’‘test’’>

<identity category=’‘pubsub’’ type=’‘leaf’’ />

  <feature var=''http://jabber.org/protocol/pubsub'' />

<x xmlns=’‘jabber:x:data’’ type=’‘result’’>

<field var=’‘FORM_TYPE’’ type=’‘hidden’’>

        <value>http://jabber.org/protocol/pubsub#meta-data</value>

<field var=’‘pubsub#creator’’ label=’‘Node creator’’>

Rachel@localhost

<field var=’‘pubsub#creation_date’’ label=’‘Creation date’’>

25/01/05 17:10

<field var=’‘pubsub#description’’ label=’‘A description of the node’’>

test3

<field var=’‘pubsub#language’’ label=’‘Default language’’>

test5

<field var=’‘pubsub#title’’ label=’‘A name for the node’’>

test2

<field var=’‘pubsub#publisher’’ label=’‘Publishers to this node’’>

Bert@localhost

Hendrik@localhost

The problem is that it is not clear to me how to use the IQ extensibility of smack to parse this piece of xml.

If I understand correctly, you CANNOT use packetextensions with IQ packets. So you would have to us an IQprovider. Now, luckely, the smack API provides the DiscoverInfo class, but it doesn’'t give me access to the tag, only to the identity and features tag.

Until now, the only solution that I can think of is to remove this DiscoverInfo provider from the smack.provider file in the library and write my one DiscoverInfoProvider class that can deal with this kind of xml.

If anybody knows a solution to my problem, they would help me a lot.

Greetz,

Stijn Van Rompaey