Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
markz #1
Member since May 2009 · 11 posts
Group memberships: Members
Show profile · Link to this post
Subject: PubSub Iq Response
I'm having some trouble with processing the response when I query a PubSub node to request all items from the node. I can't seem to get the items element on the IQ response like I can for an event. (The PubSub class does not have an Items property like PubSubEvent does.) For example, when I receive a PubSub event, this code let's me process the items:

foreach (Matrix.Xmpp.PubSub.Event.Item itm in pubSubEvent.Items.GetItems())
{
...
}

But I can't seem to drill down to the item elements in the IQ response. When I was using agsXMPP I accomplished this by calling SelectElements("item", true). How should I be doing this in Matrix?

The XML that I am trying to process is similar to what is in the example in the PubSub spec:

<iq type='result'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<items node='princely_musings'>
<item id='368866411b877c30064a5f62b917cffe'>
...
</item>
<item id='3300659945416e274474e469a1f0154c'>
...
</item>
</items>
</pubsub>
</iq>



Thanks,
Mark
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I missed to add this. I will work on this now and post a link to the update.
The items are in another namespace than in the PubSubEvent. So I must add some new classes.

Alex
Avatar
Alex #3
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
done. You can grab a new dll here http://www.ag-software.net/downloads.html when you navigate to  MatriX > Release > Mobile.
Let me know if it works.

Alex
Avatar
markz #4
Member since May 2009 · 11 posts
Group memberships: Members
Show profile · Link to this post
That works, thanks! The different namespace for PubSub queries and events is one of my least favorite features of XMPP.
Avatar
Alex #5
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by markz:
The different namespace for PubSub queries and events is one of my least favorite features of XMPP.

don't like this either. And its even worse when doing server or component programming where you have to rewrite namespaces all the time.

Alex
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:
Forum: MatriX RSS