PageRenderTime 35ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/linkedfs/usr/lib/perl5/vendor_perl/5.8.4/Net/Jabber/Query.pm

https://bitbucket.org/harakiri/trk
Perl | 2263 lines | 1384 code | 624 blank | 255 comment | 13 complexity | 65a8431d6a232b02a488ab081fa9529d MD5 | raw file
Possible License(s): GPL-2.0, MIT, LGPL-3.0
  1. ##############################################################################
  2. #
  3. # This library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Library General Public
  5. # License as published by the Free Software Foundation; either
  6. # version 2 of the License, or (at your option) any later version.
  7. #
  8. # This library is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. # Library General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU Library General Public
  14. # License along with this library; if not, write to the
  15. # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. # Boston, MA 02111-1307, USA.
  17. #
  18. # Jabber
  19. # Copyright (C) 1998-1999 The Jabber Team http://jabber.org/
  20. #
  21. ##############################################################################
  22. package Net::Jabber::Query;
  23. =head1 NAME
  24. Net::Jabber::Query - Jabber Query Library
  25. =head1 SYNOPSIS
  26. Net::Jabber::Query is a companion to the Net::Jabber::IQ module. It
  27. provides the user a simple interface to set and retrieve all
  28. parts of a Jabber IQ Query.
  29. =head1 DESCRIPTION
  30. Net::Jabber::Query differs from the other modules in that its behavior
  31. and available functions are based off of the XML namespace that is
  32. set in it. The current supported namespaces are:
  33. jabber:iq:agent
  34. jabber:iq:agents
  35. jabber:iq:auth
  36. jabber:iq:autoupdate
  37. jabber:iq:browse
  38. jabber:iq:conference
  39. jabber:iq:filter
  40. jabber:iq:gateway
  41. jabber:iq:last
  42. jabber:iq:oob
  43. jabber:iq:pass
  44. jabber:iq:register
  45. jabber:iq:roster
  46. jabber:iq:rpc
  47. jabber:iq:search
  48. jabber:iq:time
  49. jabber:iq:version
  50. http://jabber.org/protocol/bytestreams
  51. http://jabber.org/protocol/commands
  52. http://jabber.org/protocol/disco#info
  53. http://jabber.org/protocol/disco#items
  54. http://jabber.org/protocol/feature-neg
  55. http://jabber.org/protocol/muc#admin
  56. http://jabber.org/protocol/pubsub
  57. http://jabber.org/protocol/pubsub#event
  58. http://jabber.org/protocol/pubsub#owner
  59. http://jabber.org/protocol/si
  60. http://jabber.org/protocol/si/profile/file-transfer
  61. http://jabber.org/protocol/si/profile/tree-transfer
  62. http://www.jabber.org/protocol/soap # Experimental
  63. For more information on what these namespaces are for, visit
  64. http://www.jabber.org and browse the Jabber Programmers Guide.
  65. Each of these namespaces provide Net::Jabber::Query with the functions
  66. to access the data. By using the AUTOLOAD function the functions for
  67. each namespace is used when that namespace is active.
  68. To access a Query object you must create an IQ object and use the
  69. access functions there to get to the Query. To initialize the IQ with
  70. a Jabber <iq/> you must pass it the XML::Stream hash from the
  71. Net::Jabber::Client module.
  72. my $iq = new Net::Jabber::IQ(%hash);
  73. There has been a change from the old way of handling the callbacks.
  74. You no longer have to do the above yourself, a Net::Jabber::IQ
  75. object is passed to the callback function for the message. Also,
  76. the first argument to the callback functions is the session ID from
  77. XML::Streams. There are some cases where you might want this
  78. information, like if you created a Client that connects to two servers
  79. at once, or for writing a mini server.
  80. use Net::Jabber qw(Client);
  81. sub iqCB {
  82. my ($sid,$IQ) = @_;
  83. my $query = $IQ->GetQuery();
  84. .
  85. .
  86. .
  87. }
  88. You now have access to all of the retrieval functions available for
  89. that namespace.
  90. To create a new iq to send to the server:
  91. use Net::Jabber;
  92. my $iq = new Net::Jabber::IQ();
  93. $query = $iq->NewQuery("jabber:iq:register");
  94. Now you can call the creation functions for the Query as defined in the
  95. proper namespaces. See below for the general <query/> functions, and
  96. in each query module for those functions.
  97. For more information about the array format being passed to the
  98. CallBack please read the Net::Jabber::Client documentation.
  99. =head1 METHODS
  100. =head2 Retrieval functions
  101. GetXMLNS() - returns a string with the namespace of the query that
  102. the <iq/> contains.
  103. $xmlns = $IQ->GetXMLNS();
  104. GetQuery() - since the behavior of this module depends on the
  105. namespace, a Query object may contain Query objects.
  106. This helps to leverage code reuse by making children
  107. behave in the same manner. More than likely this
  108. function will never be called.
  109. @query = GetQuery()
  110. =head2 Creation functions
  111. SetXMLNS(string) - sets the xmlns of the <query/> to the string.
  112. $query->SetXMLNS("jabber:iq:roster");
  113. In an effort to make maintaining this document easier, I am not going
  114. to go into full detail on each of these functions. Rather I will
  115. present the functions in a list with a type in the first column to
  116. show what they return, or take as arugments. Here is the list of
  117. types I will use:
  118. string - just a string
  119. array - array of strings
  120. flag - this means that the specified child exists in the
  121. XML <child/> and acts like a flag. get will return
  122. 0 or 1.
  123. JID - either a string or Net::Jabber::JID object.
  124. objects - creates new objects, or returns an array of
  125. objects.
  126. special - this is a special case kind of function. Usually
  127. just by calling Set() with no arguments it will
  128. default the value to a special value, like OS or time.
  129. Sometimes it will modify the value you set, like
  130. in jabber:iq:version SetVersion() the function
  131. adds on the Net::Jabber version to the string
  132. just for advertisement purposes. =)
  133. master - this desribes a function that behaves like the
  134. SetMessage() function in Net::Jabber::Message.
  135. It takes a hash and sets all of the values defined,
  136. and the Set returns a hash with the values that
  137. are defined in the object.
  138. =head1 jabber:iq:agent
  139. Type Get Set Defined
  140. ======= ================ ================ ==================
  141. flag GetAgents() SetAgents() DefinedAgents()
  142. string GetDescription() SetDescription() DefinedDesrciption()
  143. JID GetJID() SetJID() DefinedJID()
  144. string GetName() SetName() DefinedName()
  145. flag GetGroupChat() SetGroupChat() DefinedGroupChat()
  146. flag GetRegister() SetRegister() DefinedRegister()
  147. flag GetSearch() SetSearch() DefinedSearch()
  148. string GetService() SetService() DefinedService()
  149. string GetTransport() SetTransport() DefinedTransport()
  150. string GetURL() SetURL() DefinedURL()
  151. master GetAgent() SetAgent()
  152. =head1 jabber:iq:agents
  153. Type Get Set Defined
  154. ======= ================ ================ ==================
  155. objects AddAgent() DefinedAgent()
  156. master GetAgents()
  157. =head1 jabber:iq:auth
  158. Type Get Set Defined
  159. ======= ================ ================ ==================
  160. string GetDigest() SetDigest() DefinedDigest()
  161. string GetHash() SetHash() DefiendHash()
  162. string GetPassword() SetPassword() DefinedPassword()
  163. string GetResource() SetResource() DefinedResource()
  164. string GetSequence() SetSequence() DefinedSequence()
  165. string GetToken() SetToken() DefinedToken()
  166. string GetUsername() SetUsername() DefinedUsername()
  167. master GetAuth() SetAuth()
  168. =head1 jabber:iq:autoupdate
  169. Type Get Set Defined
  170. ======= ================ ================ ==================
  171. objects GetReleases()
  172. objects AddBeta()
  173. objects AddDev()
  174. objects AddRelease()
  175. =head1 jabber:iq:autoupdate - release objects
  176. Type Get Set Defined
  177. ======= ================ ================ ==================
  178. string GetDesc() SetDesc() DefinedDesc()
  179. string GetPriority() SetPriority() DefinedPriority()
  180. string GetURL() SetURL() DefinedURL()
  181. string GetVersion() SetVersion() DefinedVersion()
  182. master GetRelease() SetRelease()
  183. =head1 jabber:iq:browse
  184. Type Get Set Defined
  185. ======= ================ ================ ==================
  186. JID GetJID() SetJID() DefinedJID()
  187. string GetName() SetName() DefinedName()
  188. string GetType() SetType() DefinedType()
  189. array GetNS() SetNS() DefinedNS()
  190. master GetBrowse() SetBrowse()
  191. objects AddItem()
  192. objects GetItems()
  193. =head1 jabber:iq:browse - item objects
  194. Type Get Set Defined
  195. ======= ================ ================ ==================
  196. JID GetJID() SetJID() DefinedJID()
  197. string GetName() SetName() DefinedName()
  198. string GetType() SetType() DefinedType()
  199. array GetNS() SetNS() DefinedNS()
  200. master GetBrowse() SetBrowse()
  201. objects AddItem()
  202. objects GetItems()
  203. =head1 jabber:iq:conference
  204. Type Get Set Defined
  205. ======= ================ ================ ==================
  206. string GetID() SetID() DefinedID()
  207. string GetName() SetName() DefinedName()
  208. array GetNick() SetNick() DefinedNick()
  209. flag GetPrivacy() SetPrivacy() DefinedPrivacy()
  210. string GetSecret() SetSecret() DefinedSecret()
  211. master GetConference() SetConference()
  212. =head1 jabber:iq:filter
  213. Type Get Set Defined
  214. ======= ================ ================ ==================
  215. objects AddRule()
  216. objects GetRules()
  217. =head1 jabber:iq:filter - rule objects
  218. Type Get Set Defined
  219. ======= ================ ================ ==================
  220. string GetBody() SetBody() DefinedBody()
  221. string GetContinued() SetContinued() DefinedContinued()
  222. string GetDrop() SetDrop() DefinedDrop()
  223. string GetEdit() SetEdit() DefinedEdit()
  224. string GetError() SetError() DefinedError()
  225. string GetFrom() SetFrom() DefinedFrom()
  226. string GetOffline() SetOffline() DefinedOffline()
  227. string GetReply() SetReply() DefinedReply()
  228. string GetResource() SetResource() DefinedResource()
  229. string GetShow() SetShow() DefinedShow()
  230. string GetSize() SetSize() DefinedSize()
  231. string GetSubject() SetSubject() DefinedSubject()
  232. string GetTime() SetTime() DefinedTime()
  233. string GetType() SetType() DefinedType()
  234. string GetUnavailable() SetUnavailable() DefinedUnavailable()
  235. master GetConference() SetConference()
  236. =head1 jabber:iq:gateway
  237. Type Get Set Defined
  238. ======= ================ ================ ==================
  239. JID GetJID() SetJID() DefinedJID()
  240. string GetDesc() SetDesc() DefinedDesc()
  241. string GetPrompt() SetPrompt() DefinedPrompt()
  242. master GetGateway() SetGateway()
  243. =head1 jabber:iq:last
  244. Type Get Set Defined
  245. ======= ================ ================ ==================
  246. string GetMessage() SetMessage() DefinedMessage()
  247. string GetSeconds() SetSeconds() DefinedSeconds()
  248. master GetLast() SetLast()
  249. =head1 jabber:iq:oob
  250. Type Get Set Defined
  251. ======= ================ ================ ==================
  252. string GetDesc() SetDesc() DefinedDesc()
  253. string GetURL() SetURL() DefinedURL()
  254. master GetOob() SetOob()
  255. =head1 jabber:iq:pass
  256. Type Get Set Defined
  257. ======= ================ ================ ==================
  258. string GetClient() SetClient() DefinedClient()
  259. string GetClientPort() SetClientPort() DefinedClientPort()
  260. string GetClose() SetClose() DefinedClose()
  261. string GetExpire() SetExpire() DefinedExpire()
  262. string GetOneShot() SetOneShot() DefinedOneShot()
  263. string GetProxy() SetProxy() DefinedProxy()
  264. string GetProxyPort() SetProxyPort() DefinedProxyPort()
  265. string GetServer() SetServer() DefinedServer()
  266. string GetServerPort() SetServerPort() DefinedServerPort()
  267. master GetPass() SetPass()
  268. =head1 jabber:iq:register
  269. Type Get Set Defined
  270. ======= ================ ================ ==================
  271. string GetAddress() SetAddress() DefinedAddress()
  272. string GetCity() SetCity() DefinedCity()
  273. string GetDate() SetDate() DefinedDate()
  274. string GetEmail() SetEmail() DefinedEmail()
  275. string GetFirst() SetFirst() DefinedFirst()
  276. string GetInstructions() SetInstructions() DefinedInstructions()
  277. string GetKey() SetKey() DefinedKey()
  278. string GetLast() SetLast() DefinedLast()
  279. string GetMisc() SetMisc() DefinedMisc()
  280. string GetName() SetName() DefinedName()
  281. string GetNick() SetNick() DefinedNick()
  282. string GetPassword() SetPassword() DefinedPassword()
  283. string GetPhone() SetPhone() DefinedPhone()
  284. flag GetRegistered() SetRegistered() DefinedRegistered()
  285. flag GetRemove() SetRemove() DefinedRemove()
  286. string GetState() SetState() DefinedState()
  287. string GetText() SetText() DefinedText()
  288. string GetURL() SetURL() DefinedURL()
  289. string GetUsername() SetUsername() DefinedUsername()
  290. string GetZip() SetZip() DefinedZip()
  291. master GetRegister() SetRegister()
  292. =head1 jabber:iq:roster
  293. Type Get Set Defined
  294. ======= ================ ================ ==================
  295. objects AddItem()
  296. objects GetItems()
  297. =head1 jabber:iq:roster - item objects
  298. Type Get Set Defined
  299. ======= ================ ================ ==================
  300. string GetAsk() SetAsk() DefinedAsk()
  301. array GetGroup() SetGroup() DefinedGroup()
  302. JID GetJID() SetJID() DefinedJID()
  303. string GetName() SetName() DefinedName()
  304. string GetSubscription() SetSubscription() DefinedSubscription()
  305. master GetItem() SetItem()
  306. =head1 jabber:iq:rpc
  307. Type Get Set Defined
  308. ======= ================ ================ ==================
  309. objects GetMethodCall() AddMethodCall() DefinedMethodCall()
  310. objects GetMethodResponse() AddMethodResponse() DefinedMethodReponse()
  311. =head1 jabber:iq:rpc - methodCall objects
  312. Type Get Set Defined
  313. ======= ================ ================ ==================
  314. string GetMethodName() SetMethodName() DefinedMethodName()
  315. objects GetParams() AddParams() DefinedParams()
  316. master GetMethodCall() SetMethodCall()
  317. =head1 jabber:iq:rpc - methodResponse objects
  318. Type Get Set Defined
  319. ======= ================ ================ ==================
  320. objects GetParams() AddParams() DefinedParams()
  321. objects GetFault() AddFault() DefinedFault()
  322. =head1 jabber:iq:rpc - fault objects
  323. Type Get Set Defined
  324. ======= ================ ================ ==================
  325. objects GetValue() AddValue() DefinedValue()
  326. =head1 jabber:iq:rpc - params objects
  327. Type Get Set Defined
  328. ======= ================ ================ ==================
  329. objects AddParam()
  330. objects GetParams()
  331. =head1 jabber:iq:rpc - param objects
  332. Type Get Set Defined
  333. ======= ================ ================ ==================
  334. objects GetValue() AddValue() DefinedValue()
  335. =head1 jabber:iq:rpc - value objects
  336. Type Get Set Defined
  337. ======= ================ ================ ==================
  338. string GetBase64() SetBase64() DefinedBase64()
  339. string GetBoolean() SetBoolean() DefinedBoolean()
  340. string GetDateTime() SetDateTime() DefinedDateTime()
  341. string GetDouble() SetDouble() DefinedDouble()
  342. string GetI4() SetI4() DefinedI4()
  343. string GetInt() SetInt() DefinedInt()
  344. string GetString() SetString() DefinedString()
  345. string GetValue() SetValue() DefinedValue()
  346. objects GetStruct() AddStruct() DefinedStruct()
  347. objects GetArray() AddArray() DefinedArray()
  348. master GetRPCValue() SetRPCValue()
  349. =head1 jabber:iq:rpc - struct objects
  350. Type Get Set Defined
  351. ======= ================ ================ ==================
  352. objects AddMember()
  353. objects GetMembers()
  354. =head1 jabber:iq:rpc - member objects
  355. Type Get Set Defined
  356. ======= ================ ================ ==================
  357. string GetName() SetName() DefinedName()
  358. objects GetValue() AddValue() DefinedValue()
  359. master GetMember() SetMember()
  360. =head1 jabber:iq:rpc - array objects
  361. Type Get Set Defined
  362. ======= ================ ================ ==================
  363. objects AddData()
  364. objects GetDatas()
  365. =head1 jabber:iq:rpc - data objects
  366. Type Get Set Defined
  367. ======= ================ ================ ==================
  368. objects GetValue() AddValue() DefinedValue()
  369. =head1 jabber:iq:search
  370. Type Get Set Defined
  371. ======= ================ ================ ==================
  372. string GetEmail() SetEmail() DefinedEmail()
  373. string GetFirst() SetFirst() DefinedFirst()
  374. string GetFamily() SetFamily() DefinedFamily()
  375. string GetGiven() SetGiven() DefinedGiven()
  376. string GetInstructions() SetInstructions() DefinedInstructions()
  377. string GetKey() SetKey() DefinedKey()
  378. string GetLast() SetLast() DefinedLast()
  379. string GetName() SetName() DefinedName()
  380. string GetNick() SetNick() DefinedNick()
  381. flag GetTruncated() SetTruncated() DefinedTruncated()
  382. master GetSearch() SetSearch()
  383. objects AddItem()
  384. objects GetItems()
  385. =head1 jabber:iq:search - item objects
  386. Type Get Set Defined
  387. ======= ================ ================ ==================
  388. string GetEmail() SetEmail() DefinedEmail()
  389. string GetFirst() SetFirst() DefinedFirst()
  390. string GetFamily() SetFamily() DefinedFamily()
  391. string GetGiven() SetGiven() DefinedGiven()
  392. JID GetJID() SetJID() DefinedJID()
  393. string GetKey() SetKey() DefinedKey()
  394. string GetLast() SetLast() DefinedLast()
  395. string GetName() SetName() DefinedName()
  396. string GetNick() SetNick() DefinedNick()
  397. master GetSearch() SetSearch()
  398. =head1 jabber:iq:time
  399. Type Get Set Defined
  400. ======= ================ ================ ==================
  401. special GetDisplay() SetDisplay() DefinedDisplay()
  402. special GetTZ() SetTZ() DefinedTZ()
  403. special GetUTC() SetUTC() DefinedUTC()
  404. master GetTime() SetTime()
  405. =head1 jabber:iq:version
  406. Type Get Set Defined
  407. ======= ================ ================ ==================
  408. string GetName() SetName() DefinedName()
  409. special GetOS() SetOS() DefinedOS()
  410. special GetVer() SetVer() DefinedVer()
  411. master GetVersion() SetVersion()
  412. =head1 http://www.jabber.org/protocol/bytestreams
  413. Type Get Set Defined
  414. ======= ================ ================ ==================
  415. string GetActivate() SetActivate() DefinedActivate()
  416. string GetStreamHostUsedJID()
  417. SetStreamHostUsedJID()
  418. DefinedStreamHostUsedJID()
  419. string GetSID() SetSID() DefinedSID()
  420. objects AddStreamHost()
  421. objects GetStreamHosts()
  422. master GetByteStreams() SetByteStreams()
  423. =head1 http://www.jabber.org/protocol/bytestreams streamhost objects
  424. Type Get Set Defined
  425. ======= ================ ================ ==================
  426. string GetHost() SetHost() DefinedHost()
  427. string GetJID() SetJID() DefinedJID()
  428. string GetPort() SetPort() DefinedPort()
  429. string GetZeroConf() SetZeroConf() DefinedZeroConf()
  430. master GetStreamHost() SetStreamHost()
  431. =head1 http://www.jabber.org/protocol/commands
  432. Type Get Set Defined
  433. ======= ================ ================ ==================
  434. string GetAction() SetAction() DefinedAction()
  435. string GetNode() SetNode() DefinedNode()
  436. string GetSessionID() SetSessionID() DefinedSessionID()
  437. objects AddNote()
  438. objects GetNotes()
  439. master GetCommand() SetCommand()
  440. =head1 http://www.jabber.org/protocol/commands note object
  441. Type Get Set Defined
  442. ======= ================ ================ ==================
  443. string GetMessage() SetMessage() DefinedMessage()
  444. string GetType() SetType() DefinedType()
  445. master GetNote() SetNote()
  446. =head1 http://www.jabber.org/protocol/disco#info
  447. Type Get Set Defined
  448. ======= ================ ================ ==================
  449. string GetNode() SetNode() DefinedNode()
  450. objects AddFeature()
  451. objects GetFeatures()
  452. objects AddIdentity()
  453. objects GetIdentities()
  454. master GetDiscoInfo() SetDiscoInfo()
  455. =head1 http://www.jabber.org/protocol/disco#info feature objects
  456. Type Get Set Defined
  457. ======= ================ ================ ==================
  458. string GetVar() SetVar() DefinedVar()
  459. master GetFeature() SetFeature()
  460. =head1 http://www.jabber.org/protocol/disco#info identity objects
  461. Type Get Set Defined
  462. ======= ================ ================ ==================
  463. string GetCategory() SetCategory() DefinedCategory()
  464. string GetName() SetName() DefinedName()
  465. string GetType() SetType() DefinedType()
  466. master GetIdentity() SetIdentity()
  467. =head1 http://www.jabber.org/protocol/disco#items
  468. Type Get Set Defined
  469. ======= ================ ================ ==================
  470. string GetNode() SetNode() DefinedNode()
  471. objects AddItem()
  472. objects GetItems()
  473. master GetDiscoItems() SetDiscoItems()
  474. =head1 http://www.jabber.org/protocol/disco#items item objects
  475. Type Get Set Defined
  476. ======= ================ ================ ==================
  477. string GetAction() SetAction() DefinedAction()
  478. string GetJID() SetJID() DefinedJID()
  479. string GetName() SetName() DefinedName()
  480. string GetNode() SetNode() DefinedNode()
  481. master GetItem() SetItem()
  482. =head1 http://www.jabber.org/protocol/feature-neg
  483. Type Get Set Defined
  484. ======= ================ ================ ==================
  485. This is just a wrapper for x:data to provide it with context.
  486. =head1 http://www.jabber.org/protocol/pubsub
  487. Type Get Set Defined
  488. ======= ================ ================ ==================
  489. objects GetAffiliations() AddAffiliations()
  490. objects GetConfigure() AddConfigure()
  491. objects GetCreate() AddCreate()
  492. objects GetDelete() AddDelete()
  493. objects GetEntities() AddEntities()
  494. objects GetEntity() AddEntity()
  495. objects GetItems() AddItems()
  496. objects GetItem() AddItem()
  497. objects GetOptions() AddOptions()
  498. objects GetPublish() AddPublish()
  499. objects GetPurge() AddPurge()
  500. objects GetRetract() AddRetract()
  501. objects GetSubscribe() AddSubscribe()
  502. objects GetUnsubscribe() AddUnsubscribe()
  503. =head1 http://www.jabber.org/protocol/pubsub affiliations objects
  504. Type Get Set Defined
  505. ======= ================ ================ ==================
  506. objects GetEntity() AddEntity()
  507. =head1 http://www.jabber.org/protocol/pubsub configure objects
  508. Type Get Set Defined
  509. ======= ================ ================ ==================
  510. string GetNode() SetNode() DefinedNode()
  511. master GetConfigure() SetConfigure()
  512. =head1 http://www.jabber.org/protocol/pubsub create objects
  513. Type Get Set Defined
  514. ======= ================ ================ ==================
  515. string GetNode() SetNode() DefinedNode()
  516. master GetCreate() SetCreate()
  517. =head1 http://www.jabber.org/protocol/pubsub delete objects
  518. Type Get Set Defined
  519. ======= ================ ================ ==================
  520. string GetNode() SetNode() DefinedNode()
  521. master GetDelete() SetDelete()
  522. =head1 http://www.jabber.org/protocol/pubsub entity objects
  523. Type Get Set Defined
  524. ======= ================ ================ ==================
  525. string GetAffiliation() SetAffiliation() DefinedAffiliation()
  526. string GetJID() SetJID() DefinedJID()
  527. string GetNode() SetNode() DefinedNode()
  528. string GetSubscription() SetSubscription() DefinedSubscription()
  529. objects GetSubscribeOptions()
  530. AddSubscribeOptions()
  531. master GetEntity() SetEntity()
  532. =head1 http://www.jabber.org/protocol/pubsub items objects
  533. Type Get Set Defined
  534. ======= ================ ================ ==================
  535. objects GetItem() AddItem()
  536. string GetMaxItems() SetMaxItems() DefinedMaxItems()
  537. string GetNode() SetNode() DefinedNode()
  538. master GetItems() SetItems()
  539. =head1 http://www.jabber.org/protocol/pubsub item objects
  540. Type Get Set Defined
  541. ======= ================ ================ ==================
  542. string GetID() SetID() DefinedID()
  543. raw GetPayload() SetPayload() DefinedPayload()
  544. master GetItem() SetItem()
  545. =head1 http://www.jabber.org/protocol/pubsub options objects
  546. Type Get Set Defined
  547. ======= ================ ================ ==================
  548. string GetJID() SetJID() DefinedJID()
  549. string GetNode() SetNode() DefinedNode()
  550. master GetOptions() SetOptions()
  551. =head1 http://www.jabber.org/protocol/pubsub publish objects
  552. Type Get Set Defined
  553. ======= ================ ================ ==================
  554. objects GetItem() AddItem()
  555. string GetNode() SetNode() DefinedNode()
  556. master GetRetract() SetRetract()
  557. =head1 http://www.jabber.org/protocol/pubsub purge objects
  558. Type Get Set Defined
  559. ======= ================ ================ ==================
  560. string GetNode() SetNode() DefinedNode()
  561. master GetPurge() SetPurge()
  562. =head1 http://www.jabber.org/protocol/pubsub retract objects
  563. Type Get Set Defined
  564. ======= ================ ================ ==================
  565. objects GetItem() AddItem()
  566. string GetNode() SetNode() DefinedNode()
  567. master GetRetract() SetRetract()
  568. =head1 http://www.jabber.org/protocol/pubsub subscribe objects
  569. Type Get Set Defined
  570. ======= ================ ================ ==================
  571. string GetJID() SetJID() DefinedJID()
  572. string GetNode() SetNode() DefinedNode()
  573. master GetSubscribe() SetSubscribe()
  574. =head1 http://www.jabber.org/protocol/pubsub subscribe-options objects
  575. Type Get Set Defined
  576. ======= ================ ================ ==================
  577. flag GetRequired() SetRequired() DefinedRequired()
  578. master GetSubscribeOptions()
  579. SetSubscriceOptions()
  580. =head1 http://www.jabber.org/protocol/pubsub unsubscribe objects
  581. Type Get Set Defined
  582. ======= ================ ================ ==================
  583. string GetJID() SetJID() DefinedJID()
  584. string GetNode() SetNode() DefinedNode()
  585. master GetUnsubscribe() SetUnsubscribe()
  586. =head1 http://www.jabber.org/protocol/pubsub#event
  587. Type Get Set Defined
  588. ======= ================ ================ ==================
  589. objects GetDelete() AddDelete()
  590. objects GetItems() AddItems()
  591. =head1 http://www.jabber.org/protocol/pubsub#event delete objects
  592. Type Get Set Defined
  593. ======= ================ ================ ==================
  594. string GetNode() SetNode() DefinedNode()
  595. master GetDelete() SetDelete()
  596. =head1 http://www.jabber.org/protocol/pubsub#event items objects
  597. Type Get Set Defined
  598. ======= ================ ================ ==================
  599. objects GetItem() AddItem()
  600. string GetNode() SetNode() DefinedNode()
  601. master GetItems() SetItems()
  602. =head1 http://www.jabber.org/protocol/pubsub#event item objects
  603. Type Get Set Defined
  604. ======= ================ ================ ==================
  605. string GetID() SetID() DefinedID()
  606. raw GetPayload() SetPayload() DefinedPayload()
  607. master GetItem() SetItem()
  608. =head1 http://www.jabber.org/protocol/pubsub#owner
  609. Type Get Set Defined
  610. ======= ================ ================ ==================
  611. string GetAction() SetAction() DefinedAction()
  612. objects GetConfigure() AddConfigure()
  613. master GetOwner() SetOwner()
  614. =head1 http://www.jabber.org/protocol/pubsub#owner configure objects
  615. Type Get Set Defined
  616. ======= ================ ================ ==================
  617. string GetNode() SetNode() DefinedNode()
  618. master GetConfigure() SetConfigure()
  619. =head1 http://www.jabber.org/protocol/si
  620. Type Get Set Defined
  621. ======= ================ ================ ==================
  622. string GetID() SetID() DefinedID()
  623. string GetMimeType() SetMimeType() DefinedMimeType()
  624. string GetProfile() SetProfile() DefinedProfile()
  625. master GetStream() SetStream()
  626. =head1 http://www.jabber.org/protocol/si/profile/file-transfer
  627. Type Get Set Defined
  628. ======= ================ ================ ==================
  629. string GetDate() SetDate() DefinedDate()
  630. string GetDesc() SetDesc() DefinedDesc()
  631. string GetHash() SetHash() DefinedHash()
  632. string GetName() SetName() DefinedName()
  633. string GetRange() SetRange() DefinedRange()
  634. string GetRangeOffset() SetRangeOffset() DefinedRangeOffset()
  635. string GetRangeLength() SetRangeLength() DefinedRangeLength()
  636. string GetSize() SetSize() DefinedSize()
  637. master GetFile() SetFile()
  638. =head1 http://www.jabber.org/protocol/soap - Experimental
  639. Type Get Set Defined
  640. ======= ================ ================ ==================
  641. raw GetPayload() SetPayload() DefinedPayload()
  642. master GetSoap() SetSoap()
  643. =head1 CUSTOM NAMESPACES
  644. Part of the flexability of this module is that you can define your own
  645. namespace. For more information on this topic, please read the
  646. Net::Jabber::Namespaces man page.
  647. =head1 AUTHOR
  648. By Ryan Eatmon in May of 2001 for http://jabber.org..
  649. =head1 COPYRIGHT
  650. This module is free software; you can redistribute it and/or modify
  651. it under the same terms as Perl itself.
  652. =cut
  653. require 5.003;
  654. use strict;
  655. use Carp;
  656. use vars qw($VERSION %FUNCTIONS %NAMESPACES %TAGS $AUTOLOAD);
  657. $VERSION = "1.30";
  658. sub new
  659. {
  660. my $proto = shift;
  661. my $class = ref($proto) || $proto;
  662. my $self = { };
  663. $self->{VERSION} = $VERSION;
  664. bless($self, $proto);
  665. $self->{DEBUGHEADER} = "Query";
  666. $self->{DATA} = {};
  667. $self->{CHILDREN} = {};
  668. $self->{TAG} = "query";
  669. if ("@_" ne (""))
  670. {
  671. if (ref($_[0]) eq "Net::Jabber::Query")
  672. {
  673. return $_[0];
  674. }
  675. elsif (ref($_[0]) eq "")
  676. {
  677. $self->{TAG} = shift;
  678. $self->{TREE} = new XML::Stream::Node($self->{TAG});
  679. }
  680. else
  681. {
  682. $self->{TREE} = shift;
  683. $self->{TAG} = $self->{TREE}->get_tag();
  684. $self->ParseXMLNS();
  685. $self->ParseTree();
  686. }
  687. }
  688. else
  689. {
  690. $self->{TREE} = new XML::Stream::Node($self->{TAG});
  691. }
  692. return $self;
  693. }
  694. ##############################################################################
  695. #
  696. # AUTOLOAD - This function calls the main AutoLoad function in Jabber.pm
  697. #
  698. ##############################################################################
  699. sub AUTOLOAD
  700. {
  701. my $self = shift;
  702. &Net::Jabber::AutoLoad($self,$AUTOLOAD,@_);
  703. }
  704. $FUNCTIONS{XMLNS}->{XPath}->{Path} = '@xmlns';
  705. $FUNCTIONS{Query}->{XPath}->{Type} = 'node';
  706. $FUNCTIONS{Query}->{XPath}->{Path} = '*[@xmlns]';
  707. $FUNCTIONS{Query}->{XPath}->{Child} = 'Query';
  708. $FUNCTIONS{Query}->{XPath}->{Calls} = ['Get','Defined'];
  709. $FUNCTIONS{X}->{XPath}->{Type} = 'node';
  710. $FUNCTIONS{X}->{XPath}->{Path} = '*[@xmlns]';
  711. $FUNCTIONS{X}->{XPath}->{Child} = 'X';
  712. $FUNCTIONS{X}->{XPath}->{Calls} = ['Get','Defined'];
  713. my $ns;
  714. #-----------------------------------------------------------------------------
  715. # jabber:iq:agent
  716. #-----------------------------------------------------------------------------
  717. $ns = 'jabber:iq:agent';
  718. $NAMESPACES{$ns}->{Agents}->{XPath}->{Type} = 'flag';
  719. $NAMESPACES{$ns}->{Agents}->{XPath}->{Path} = 'agents';
  720. $NAMESPACES{$ns}->{Description}->{XPath}->{Path} = 'description/text()';
  721. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  722. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  723. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = 'name/text()';
  724. $NAMESPACES{$ns}->{GroupChat}->{XPath}->{Type} = 'flag';
  725. $NAMESPACES{$ns}->{GroupChat}->{XPath}->{Path} = 'groupchat';
  726. $NAMESPACES{$ns}->{Register}->{XPath}->{Type} = 'flag';
  727. $NAMESPACES{$ns}->{Register}->{XPath}->{Path} = 'register';
  728. $NAMESPACES{$ns}->{Search}->{XPath}->{Type} = 'flag';
  729. $NAMESPACES{$ns}->{Search}->{XPath}->{Path} = 'search';
  730. $NAMESPACES{$ns}->{Service}->{XPath}->{Path} = 'service/text()';
  731. $NAMESPACES{$ns}->{Transport}->{XPath}->{Path} = 'transport/text()';
  732. $NAMESPACES{$ns}->{URL}->{XPath}->{Path} = 'url/text()';
  733. $NAMESPACES{$ns}->{Agent}->{XPath}->{Type} = 'master';
  734. #-----------------------------------------------------------------------------
  735. # jabber:iq:agents
  736. #-----------------------------------------------------------------------------
  737. $ns = 'jabber:iq:agents';
  738. $NAMESPACES{$ns}->{Agent}->{XPath}->{Type} = 'node';
  739. $NAMESPACES{$ns}->{Agent}->{XPath}->{Path} = 'agent';
  740. $NAMESPACES{$ns}->{Agent}->{XPath}->{Child} = ['Query','jabber:iq:agent',"__netjabber__:skip_xmlns"];
  741. $NAMESPACES{$ns}->{Agent}->{XPath}->{Calls} = ['Add'];
  742. $NAMESPACES{$ns}->{Agents}->{XPath}->{Type} = 'children';
  743. $NAMESPACES{$ns}->{Agents}->{XPath}->{Path} = 'agent';
  744. $NAMESPACES{$ns}->{Agents}->{XPath}->{Child} = ['Query','jabber:iq:agent'];
  745. $NAMESPACES{$ns}->{Agents}->{XPath}->{Calls} = ['Get'];
  746. #-----------------------------------------------------------------------------
  747. # jabber:iq:auth
  748. #-----------------------------------------------------------------------------
  749. $ns = 'jabber:iq:auth';
  750. $NAMESPACES{$ns}->{Digest}->{XPath}->{Path} = 'digest/text()';
  751. $NAMESPACES{$ns}->{Hash}->{XPath}->{Path} = 'hash/text()';
  752. $NAMESPACES{$ns}->{Password}->{XPath}->{Path} = 'password/text()';
  753. $NAMESPACES{$ns}->{Resource}->{XPath}->{Path} = 'resource/text()';
  754. $NAMESPACES{$ns}->{Sequence}->{XPath}->{Path} = 'sequence/text()';
  755. $NAMESPACES{$ns}->{Token}->{XPath}->{Path} = 'token/text()';
  756. $NAMESPACES{$ns}->{Username}->{XPath}->{Path} = 'username/text()';
  757. $NAMESPACES{$ns}->{Auth}->{XPath}->{Type} = 'master';
  758. #-----------------------------------------------------------------------------
  759. # jabber:iq:autoupdate
  760. #-----------------------------------------------------------------------------
  761. $ns = 'jabber:iq:autoupdate';
  762. $NAMESPACES{$ns}->{Beta}->{XPath}->{Type} = 'node';
  763. $NAMESPACES{$ns}->{Beta}->{XPath}->{Path} = 'beta';
  764. $NAMESPACES{$ns}->{Beta}->{XPath}->{Child} = ['Query','__netjabber__:iq:autoupdate:release'];
  765. $NAMESPACES{$ns}->{Beta}->{XPath}->{Calls} = ['Add'];
  766. $NAMESPACES{$ns}->{Dev}->{XPath}->{Type} = 'node';
  767. $NAMESPACES{$ns}->{Dev}->{XPath}->{Path} = 'dev';
  768. $NAMESPACES{$ns}->{Dev}->{XPath}->{Child} = ['Query','__netjabber__:iq:autoupdate:release'];
  769. $NAMESPACES{$ns}->{Dev}->{XPath}->{Calls} = ['Add'];
  770. $NAMESPACES{$ns}->{Release}->{XPath}->{Type} = 'node';
  771. $NAMESPACES{$ns}->{Release}->{XPath}->{Path} = 'release';
  772. $NAMESPACES{$ns}->{Release}->{XPath}->{Child} = ['Query','__netjabber__:iq:autoupdate:release'];
  773. $NAMESPACES{$ns}->{Release}->{XPath}->{Calls} = ['Add'];
  774. $NAMESPACES{$ns}->{Releases}->{XPath}->{Type} = 'children';
  775. $NAMESPACES{$ns}->{Releases}->{XPath}->{Path} = '*';
  776. $NAMESPACES{$ns}->{Releases}->{XPath}->{Child} = ['Query','__netjabber__:iq:autoupdate:release'];
  777. $NAMESPACES{$ns}->{Releases}->{XPath}->{Calls} = ['Get'];
  778. #-----------------------------------------------------------------------------
  779. # __netjabber__:iq:autoupdate:release
  780. #-----------------------------------------------------------------------------
  781. $ns = '__netjabber__:iq:autoupdate:release';
  782. $NAMESPACES{$ns}->{Desc}->{XPath}->{Path} = 'desc/text()';
  783. $NAMESPACES{$ns}->{Priority}->{XPath}->{Path} = '@priority';
  784. $NAMESPACES{$ns}->{URL}->{XPath}->{Path} = 'url/text()';
  785. $NAMESPACES{$ns}->{Version}->{XPath}->{Path} = 'version/text()';
  786. $NAMESPACES{$ns}->{Release}->{XPath}->{Type} = 'master';
  787. #-----------------------------------------------------------------------------
  788. # jabber:iq:browse
  789. #-----------------------------------------------------------------------------
  790. $ns = 'jabber:iq:browse';
  791. $NAMESPACES{$ns}->{Category}->{XPath}->{Path} = '@category';
  792. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  793. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  794. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = '@name';
  795. $NAMESPACES{$ns}->{Type}->{XPath}->{Path} = '@type';
  796. $NAMESPACES{$ns}->{NS}->{XPath}->{Type} = 'array';
  797. $NAMESPACES{$ns}->{NS}->{XPath}->{Path} = 'ns/text()';
  798. $NAMESPACES{$ns}->{Browse}->{XPath}->{Type} = 'master';
  799. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'node';
  800. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = '*[name() != "ns"]';
  801. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:browse','__netjabber__:specifyname','item'];
  802. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add'];
  803. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'children';
  804. $NAMESPACES{$ns}->{Items}->{XPath}->{Path} = '*[name() != "ns"]';
  805. $NAMESPACES{$ns}->{Items}->{XPath}->{Child} = ['Query','__netjabber__:iq:browse'];
  806. $NAMESPACES{$ns}->{Items}->{XPath}->{Calls} = ['Get'];
  807. #-----------------------------------------------------------------------------
  808. # __netjabber__:iq:browse
  809. #-----------------------------------------------------------------------------
  810. $ns = '__netjabber__:iq:browse';
  811. $NAMESPACES{$ns}->{Category}->{XPath}->{Path} = '@category';
  812. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  813. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  814. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = '@name';
  815. $NAMESPACES{$ns}->{Type}->{XPath}->{Path} = '@type';
  816. $NAMESPACES{$ns}->{NS}->{XPath}->{Type} = 'array';
  817. $NAMESPACES{$ns}->{NS}->{XPath}->{Path} = 'ns/text()';
  818. $NAMESPACES{$ns}->{Browse}->{XPath}->{Type} = 'master';
  819. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'node';
  820. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = '*[name() != "ns"]';
  821. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:browse','__netjabber__:specifyname','item'];
  822. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add'];
  823. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'children';
  824. $NAMESPACES{$ns}->{Items}->{XPath}->{Path} = '*[name() != "ns"]';
  825. $NAMESPACES{$ns}->{Items}->{XPath}->{Child} = ['Query','__netjabber__:iq:browse'];
  826. $NAMESPACES{$ns}->{Items}->{XPath}->{Calls} = ['Get'];
  827. #-----------------------------------------------------------------------------
  828. # jabber:iq:conference
  829. #-----------------------------------------------------------------------------
  830. $ns = 'jabber:iq:conference';
  831. $NAMESPACES{$ns}->{ID}->{XPath}->{Path} = 'id/text()';
  832. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = 'name/text()';
  833. $NAMESPACES{$ns}->{Nick}->{XPath}->{Path} = 'nick/text()';
  834. $NAMESPACES{$ns}->{Privacy}->{XPath}->{Type} = 'flag';
  835. $NAMESPACES{$ns}->{Privacy}->{XPath}->{Path} = 'privacy';
  836. $NAMESPACES{$ns}->{Secret}->{XPath}->{Path} = 'secret/text()';
  837. $NAMESPACES{$ns}->{Conference}->{XPath}->{Type} = 'master';
  838. #-----------------------------------------------------------------------------
  839. # jabber:iq:filter
  840. #-----------------------------------------------------------------------------
  841. $ns = 'jabber:iq:filter';
  842. $NAMESPACES{$ns}->{Rule}->{XPath}->{Type} = 'node';
  843. $NAMESPACES{$ns}->{Rule}->{XPath}->{Path} = 'rule';
  844. $NAMESPACES{$ns}->{Rule}->{XPath}->{Child} = ['Query','__netjabber__:iq:filter:rule'];
  845. $NAMESPACES{$ns}->{Rule}->{XPath}->{Calls} = ['Add'];
  846. $NAMESPACES{$ns}->{Rules}->{XPath}->{Type} = 'children';
  847. $NAMESPACES{$ns}->{Rules}->{XPath}->{Path} = 'rule';
  848. $NAMESPACES{$ns}->{Rules}->{XPath}->{Child} = ['Query','__netjabber__:iq:filter:rule'];
  849. $NAMESPACES{$ns}->{Rules}->{XPath}->{Calls} = ['Get'];
  850. #-----------------------------------------------------------------------------
  851. # __netjabber__:iq:filter:rule
  852. #-----------------------------------------------------------------------------
  853. $ns = '__netjabber__:iq:filter:rule';
  854. $NAMESPACES{$ns}->{Body}->{XPath}->{Path} = 'body/text()';
  855. $NAMESPACES{$ns}->{Continued}->{XPath}->{Path} = 'continued/text()';
  856. $NAMESPACES{$ns}->{Drop}->{XPath}->{Path} = 'drop/text()';
  857. $NAMESPACES{$ns}->{Edit}->{XPath}->{Path} = 'edit/text()';
  858. $NAMESPACES{$ns}->{Error}->{XPath}->{Path} = 'error/text()';
  859. $NAMESPACES{$ns}->{From}->{XPath}->{Path} = 'from/text()';
  860. $NAMESPACES{$ns}->{Offline}->{XPath}->{Path} = 'offline/text()';
  861. $NAMESPACES{$ns}->{Reply}->{XPath}->{Path} = 'reply/text()';
  862. $NAMESPACES{$ns}->{Resource}->{XPath}->{Path} = 'resource/text()';
  863. $NAMESPACES{$ns}->{Show}->{XPath}->{Path} = 'show/text()';
  864. $NAMESPACES{$ns}->{Size}->{XPath}->{Path} = 'size/text()';
  865. $NAMESPACES{$ns}->{Subject}->{XPath}->{Path} = 'subject/text()';
  866. $NAMESPACES{$ns}->{Time}->{XPath}->{Path} = 'time/text()';
  867. $NAMESPACES{$ns}->{Type}->{XPath}->{Path} = 'type/text()';
  868. $NAMESPACES{$ns}->{Unavailable}->{XPath}->{Path} = 'unavailable/text()';
  869. $NAMESPACES{$ns}->{Rule}->{XPath}->{Type} = 'master';
  870. #-----------------------------------------------------------------------------
  871. # jabber:iq:gateway
  872. #-----------------------------------------------------------------------------
  873. $ns = 'jabber:iq:gateway';
  874. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  875. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = 'jid/text()';
  876. $NAMESPACES{$ns}->{Desc}->{XPath}->{Path} = 'desc/text()';
  877. $NAMESPACES{$ns}->{Prompt}->{XPath}->{Path} = 'prompt/text()';
  878. $NAMESPACES{$ns}->{Gateway}->{XPath}->{Type} = 'master';
  879. #-----------------------------------------------------------------------------
  880. # jabber:iq:last
  881. #-----------------------------------------------------------------------------
  882. $ns = 'jabber:iq:last';
  883. $NAMESPACES{$ns}->{Message}->{XPath}->{Path} = 'text()';
  884. $NAMESPACES{$ns}->{Seconds}->{XPath}->{Path} = '@seconds';
  885. $NAMESPACES{$ns}->{Last}->{XPath}->{Type} = 'master';
  886. #-----------------------------------------------------------------------------
  887. # jabber:iq:oob
  888. #-----------------------------------------------------------------------------
  889. $ns = 'jabber:iq:oob';
  890. $NAMESPACES{$ns}->{Desc}->{XPath}->{Path} = 'desc/text()';
  891. $NAMESPACES{$ns}->{URL}->{XPath}->{Path} = 'url/text()';
  892. $NAMESPACES{$ns}->{Oob}->{XPath}->{Type} = 'master';
  893. #-----------------------------------------------------------------------------
  894. # jabber:iq:pass
  895. #-----------------------------------------------------------------------------
  896. $ns = 'jabber:iq:pass';
  897. $NAMESPACES{$ns}->{Client}->{XPath}->{Path} = 'client/text()';
  898. $NAMESPACES{$ns}->{ClientPort}->{XPath}->{Path} = 'client/@port';
  899. $NAMESPACES{$ns}->{Close}->{XPath}->{Type} = 'flag';
  900. $NAMESPACES{$ns}->{Close}->{XPath}->{Path} = 'close';
  901. $NAMESPACES{$ns}->{Expire}->{XPath}->{Path} = 'expire/text()';
  902. $NAMESPACES{$ns}->{OneShot}->{XPath}->{Type} = 'flag';
  903. $NAMESPACES{$ns}->{OneShot}->{XPath}->{Path} = 'oneshot';
  904. $NAMESPACES{$ns}->{Proxy}->{XPath}->{Path} = 'proxy/text()';
  905. $NAMESPACES{$ns}->{ProxyPort}->{XPath}->{Path} = 'proxy/@port';
  906. $NAMESPACES{$ns}->{Server}->{XPath}->{Path} = 'server/text()';
  907. $NAMESPACES{$ns}->{ServerPort}->{XPath}->{Path} = 'server/@port';
  908. $NAMESPACES{$ns}->{Pass}->{XPath}->{Type} = 'master';
  909. #-----------------------------------------------------------------------------
  910. # jabber:iq:register
  911. #-----------------------------------------------------------------------------
  912. $ns = 'jabber:iq:register';
  913. $NAMESPACES{$ns}->{Address}->{XPath}->{Path} = 'address/text()';
  914. $NAMESPACES{$ns}->{City}->{XPath}->{Path} = 'city/text()';
  915. $NAMESPACES{$ns}->{Date}->{XPath}->{Path} = 'date/text()';
  916. $NAMESPACES{$ns}->{Email}->{XPath}->{Path} = 'email/text()';
  917. $NAMESPACES{$ns}->{First}->{XPath}->{Path} = 'first/text()';
  918. $NAMESPACES{$ns}->{Instructions}->{XPath}->{Path} = 'instructions/text()';
  919. $NAMESPACES{$ns}->{Key}->{XPath}->{Path} = 'key/text()';
  920. $NAMESPACES{$ns}->{Last}->{XPath}->{Path} = 'last/text()';
  921. $NAMESPACES{$ns}->{Misc}->{XPath}->{Path} = 'misc/text()';
  922. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = 'name/text()';
  923. $NAMESPACES{$ns}->{Nick}->{XPath}->{Path} = 'nick/text()';
  924. $NAMESPACES{$ns}->{Password}->{XPath}->{Path} = 'password/text()';
  925. $NAMESPACES{$ns}->{Phone}->{XPath}->{Path} = 'phone/text()';
  926. $NAMESPACES{$ns}->{Registered}->{XPath}->{Type} = 'flag';
  927. $NAMESPACES{$ns}->{Registered}->{XPath}->{Path} = 'registered';
  928. $NAMESPACES{$ns}->{Remove}->{XPath}->{Type} = 'flag';
  929. $NAMESPACES{$ns}->{Remove}->{XPath}->{Path} = 'remove';
  930. $NAMESPACES{$ns}->{State}->{XPath}->{Path} = 'state/text()';
  931. $NAMESPACES{$ns}->{Text}->{XPath}->{Path} = 'text/text()';
  932. $NAMESPACES{$ns}->{URL}->{XPath}->{Path} = 'url/text()';
  933. $NAMESPACES{$ns}->{Username}->{XPath}->{Path} = 'username/text()';
  934. $NAMESPACES{$ns}->{Zip}->{XPath}->{Path} = 'zip/text()';
  935. $NAMESPACES{$ns}->{Register}->{XPath}->{Type} = 'master';
  936. #-----------------------------------------------------------------------------
  937. # jabber:iq:roster
  938. #-----------------------------------------------------------------------------
  939. $ns = 'jabber:iq:roster';
  940. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'node';
  941. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  942. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:roster:item'];
  943. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add'];
  944. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'children';
  945. $NAMESPACES{$ns}->{Items}->{XPath}->{Path} = 'item';
  946. $NAMESPACES{$ns}->{Items}->{XPath}->{Child} = ['Query','__netjabber__:iq:roster:item'];
  947. $NAMESPACES{$ns}->{Items}->{XPath}->{Calls} = ['Get'];
  948. #-----------------------------------------------------------------------------
  949. # __netjabber__:iq:roster:item
  950. #-----------------------------------------------------------------------------
  951. $ns = '__netjabber__:iq:roster:item';
  952. $NAMESPACES{$ns}->{Ask}->{XPath}->{Path} = '@ask';
  953. $NAMESPACES{$ns}->{Group}->{XPath}->{Type} = 'array';
  954. $NAMESPACES{$ns}->{Group}->{XPath}->{Path} = 'group/text()';
  955. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  956. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  957. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = '@name';
  958. $NAMESPACES{$ns}->{Subscription}->{XPath}->{Path} = '@subscription';
  959. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'master';
  960. #-----------------------------------------------------------------------------
  961. # jabber:iq:rpc
  962. #-----------------------------------------------------------------------------
  963. $ns = 'jabber:iq:rpc';
  964. $NAMESPACES{$ns}->{MethodCall}->{XPath}->{Type} = 'children';
  965. $NAMESPACES{$ns}->{MethodCall}->{XPath}->{Path} = 'methodCall';
  966. $NAMESPACES{$ns}->{MethodCall}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:methodCall'];
  967. $NAMESPACES{$ns}->{MethodCall}->{XPath}->{Calls} = ['Get','Defined','Add'];
  968. $NAMESPACES{$ns}->{MethodResponse}->{XPath}->{Type} = 'children';
  969. $NAMESPACES{$ns}->{MethodResponse}->{XPath}->{Path} = 'methodResponse';
  970. $NAMESPACES{$ns}->{MethodResponse}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:methodResponse'];
  971. $NAMESPACES{$ns}->{MethodResponse}->{XPath}->{Calls} = ['Get','Defined','Add'];
  972. #-----------------------------------------------------------------------------
  973. # __netjabber__:iq:rpc:methodCall
  974. #-----------------------------------------------------------------------------
  975. $ns = '__netjabber__:iq:rpc:methodCall';
  976. $NAMESPACES{$ns}->{MethodName}->{XPath}->{Path} = 'methodName/text()';
  977. $NAMESPACES{$ns}->{Params}->{XPath}->{Type} = 'children';
  978. $NAMESPACES{$ns}->{Params}->{XPath}->{Path} = 'params';
  979. $NAMESPACES{$ns}->{Params}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:params'];
  980. $NAMESPACES{$ns}->{Params}->{XPath}->{Calls} = ['Get','Defined','Add'];
  981. $NAMESPACES{$ns}->{MethodCall}->{XPath}->{Type} = 'master';
  982. #-----------------------------------------------------------------------------
  983. # __netjabber__:iq:rpc:methodResponse
  984. #-----------------------------------------------------------------------------
  985. $ns = '__netjabber__:iq:rpc:methodResponse';
  986. $NAMESPACES{$ns}->{Params}->{XPath}->{Type} = 'children';
  987. $NAMESPACES{$ns}->{Params}->{XPath}->{Path} = 'params';
  988. $NAMESPACES{$ns}->{Params}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:params'];
  989. $NAMESPACES{$ns}->{Params}->{XPath}->{Calls} = ['Get','Defined','Add'];
  990. $NAMESPACES{$ns}->{Fault}->{XPath}->{Type} = 'children';
  991. $NAMESPACES{$ns}->{Fault}->{XPath}->{Path} = 'fault';
  992. $NAMESPACES{$ns}->{Fault}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:fault'];
  993. $NAMESPACES{$ns}->{Fault}->{XPath}->{Calls} = ['Get','Defined','Add'];
  994. #-----------------------------------------------------------------------------
  995. # __netjabber__:iq:rpc:fault
  996. #-----------------------------------------------------------------------------
  997. $ns = '__netjabber__:iq:rpc:fault';
  998. $NAMESPACES{$ns}->{Value}->{XPath}->{Type} = 'children';
  999. $NAMESPACES{$ns}->{Value}->{XPath}->{Path} = 'value';
  1000. $NAMESPACES{$ns}->{Value}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:value'];
  1001. $NAMESPACES{$ns}->{Value}->{XPath}->{Calls} = ['Get','Defined','Add'];
  1002. #-----------------------------------------------------------------------------
  1003. # __netjabber__:iq:rpc:params
  1004. #-----------------------------------------------------------------------------
  1005. $ns = '__netjabber__:iq:rpc:params';
  1006. $NAMESPACES{$ns}->{Param}->{XPath}->{Type} = 'node';
  1007. $NAMESPACES{$ns}->{Param}->{XPath}->{Path} = 'param';
  1008. $NAMESPACES{$ns}->{Param}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:param'];
  1009. $NAMESPACES{$ns}->{Param}->{XPath}->{Calls} = ['Add'];
  1010. $NAMESPACES{$ns}->{Params}->{XPath}->{Type} = 'children';
  1011. $NAMESPACES{$ns}->{Params}->{XPath}->{Path} = 'param';
  1012. $NAMESPACES{$ns}->{Params}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:param'];
  1013. $NAMESPACES{$ns}->{Params}->{XPath}->{Calls} = ['Get'];
  1014. #-----------------------------------------------------------------------------
  1015. # __netjabber__:iq:rpc:param
  1016. #-----------------------------------------------------------------------------
  1017. $ns = '__netjabber__:iq:rpc:param';
  1018. $NAMESPACES{$ns}->{Value}->{XPath}->{Type} = 'children';
  1019. $NAMESPACES{$ns}->{Value}->{XPath}->{Path} = 'value';
  1020. $NAMESPACES{$ns}->{Value}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:value'];
  1021. $NAMESPACES{$ns}->{Value}->{XPath}->{Calls} = ['Get','Defined','Add'];
  1022. #-----------------------------------------------------------------------------
  1023. # __netjabber__:iq:rpc:value
  1024. #-----------------------------------------------------------------------------
  1025. $ns = '__netjabber__:iq:rpc:value';
  1026. $NAMESPACES{$ns}->{Base64}->{XPath}->{Path} = 'base64/text()';
  1027. $NAMESPACES{$ns}->{Boolean}->{XPath}->{Path} = 'boolean/text()';
  1028. $NAMESPACES{$ns}->{DateTime}->{XPath}->{Path} = 'dateTime.iso8601/text()';
  1029. $NAMESPACES{$ns}->{Double}->{XPath}->{Path} = 'double/text()';
  1030. $NAMESPACES{$ns}->{I4}->{XPath}->{Path} = 'i4/text()';
  1031. $NAMESPACES{$ns}->{Int}->{XPath}->{Path} = 'int/text()';
  1032. $NAMESPACES{$ns}->{String}->{XPath}->{Path} = 'string/text()';
  1033. $NAMESPACES{$ns}->{Value}->{XPath}->{Path} = 'value/text()';
  1034. $NAMESPACES{$ns}->{RPCValue}->{XPath}->{Type} = 'master';
  1035. $NAMESPACES{$ns}->{Struct}->{XPath}->{Type} = 'children';
  1036. $NAMESPACES{$ns}->{Struct}->{XPath}->{Path} = 'struct';
  1037. $NAMESPACES{$ns}->{Struct}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:struct'];
  1038. $NAMESPACES{$ns}->{Struct}->{XPath}->{Calls} = ['Get','Defined','Add'];
  1039. $NAMESPACES{$ns}->{Array}->{XPath}->{Type} = 'children';
  1040. $NAMESPACES{$ns}->{Array}->{XPath}->{Path} = 'array';
  1041. $NAMESPACES{$ns}->{Array}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:array'];
  1042. $NAMESPACES{$ns}->{Array}->{XPath}->{Calls} = ['Get','Defined','Add'];
  1043. #-----------------------------------------------------------------------------
  1044. # __netjabber__:iq:rpc:struct
  1045. #-----------------------------------------------------------------------------
  1046. $ns = '__netjabber__:iq:rpc:struct';
  1047. $NAMESPACES{$ns}->{Member}->{XPath}->{Type} = 'node';
  1048. $NAMESPACES{$ns}->{Member}->{XPath}->{Path} = 'member';
  1049. $NAMESPACES{$ns}->{Member}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:struct:member'];
  1050. $NAMESPACES{$ns}->{Member}->{XPath}->{Calls} = ['Add'];
  1051. $NAMESPACES{$ns}->{Members}->{XPath}->{Type} = 'children';
  1052. $NAMESPACES{$ns}->{Members}->{XPath}->{Path} = 'member';
  1053. $NAMESPACES{$ns}->{Members}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:struct:member'];
  1054. $NAMESPACES{$ns}->{Members}->{XPath}->{Calls} = ['Get'];
  1055. #-----------------------------------------------------------------------------
  1056. # __netjabber__:iq:rpc:struct:member
  1057. #-----------------------------------------------------------------------------
  1058. $ns = '__netjabber__:iq:rpc:struct:member';
  1059. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = 'name/text()';
  1060. $NAMESPACES{$ns}->{Value}->{XPath}->{Type} = 'children';
  1061. $NAMESPACES{$ns}->{Value}->{XPath}->{Path} = 'value';
  1062. $NAMESPACES{$ns}->{Value}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:value'];
  1063. $NAMESPACES{$ns}->{Value}->{XPath}->{Calls} = ['Get','Defined','Add'];
  1064. $NAMESPACES{$ns}->{Member}->{XPath}->{Type} = 'master';
  1065. #-----------------------------------------------------------------------------
  1066. # __netjabber__:iq:rpc:array
  1067. #-----------------------------------------------------------------------------
  1068. $ns = '__netjabber__:iq:rpc:array';
  1069. $NAMESPACES{$ns}->{Data}->{XPath}->{Type} = 'node';
  1070. $NAMESPACES{$ns}->{Data}->{XPath}->{Path} = 'data';
  1071. $NAMESPACES{$ns}->{Data}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:array:data'];
  1072. $NAMESPACES{$ns}->{Data}->{XPath}->{Calls} = ['Add'];
  1073. $NAMESPACES{$ns}->{Datas}->{XPath}->{Type} = 'children';
  1074. $NAMESPACES{$ns}->{Datas}->{XPath}->{Path} = 'data';
  1075. $NAMESPACES{$ns}->{Datas}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:array:data'];
  1076. $NAMESPACES{$ns}->{Datas}->{XPath}->{Calls} = ['Get'];
  1077. #-----------------------------------------------------------------------------
  1078. # __netjabber__:iq:rpc:array:data
  1079. #-----------------------------------------------------------------------------
  1080. $ns = '__netjabber__:iq:rpc:array:data';
  1081. $NAMESPACES{$ns}->{Value}->{XPath}->{Type} = 'children';
  1082. $NAMESPACES{$ns}->{Value}->{XPath}->{Path} = 'value';
  1083. $NAMESPACES{$ns}->{Value}->{XPath}->{Child} = ['Query','__netjabber__:iq:rpc:value'];
  1084. $NAMESPACES{$ns}->{Value}->{XPath}->{Calls} = ['Get','Defined','Add'];
  1085. #-----------------------------------------------------------------------------
  1086. # jabber:iq:search
  1087. #-----------------------------------------------------------------------------
  1088. $ns = 'jabber:iq:search';
  1089. $NAMESPACES{$ns}->{Email}->{XPath}->{Path} = 'email/text()';
  1090. $NAMESPACES{$ns}->{Family}->{XPath}->{Path} = 'family/text()';
  1091. $NAMESPACES{$ns}->{First}->{XPath}->{Path} = 'first/text()';
  1092. $NAMESPACES{$ns}->{Given}->{XPath}->{Path} = 'given/text()';
  1093. $NAMESPACES{$ns}->{Instructions}->{XPath}->{Path} = 'instructions/text()';
  1094. $NAMESPACES{$ns}->{Key}->{XPath}->{Path} = 'key/text()';
  1095. $NAMESPACES{$ns}->{Last}->{XPath}->{Path} = 'last/text()';
  1096. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = 'name/text()';
  1097. $NAMESPACES{$ns}->{Nick}->{XPath}->{Path} = 'nick/text()';
  1098. $NAMESPACES{$ns}->{Truncated}->{XPath}->{Type} = 'flag';
  1099. $NAMESPACES{$ns}->{Truncated}->{XPath}->{Path} = 'truncated';
  1100. $NAMESPACES{$ns}->{Search}->{XPath}->{Type} = 'master';
  1101. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'node';
  1102. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  1103. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:search:item'];
  1104. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add'];
  1105. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'children';
  1106. $NAMESPACES{$ns}->{Items}->{XPath}->{Path} = 'item';
  1107. $NAMESPACES{$ns}->{Items}->{XPath}->{Child} = ['Query','__netjabber__:iq:search:item'];
  1108. $NAMESPACES{$ns}->{Items}->{XPath}->{Calls} = ['Get'];
  1109. #-----------------------------------------------------------------------------
  1110. # __netjabber__:iq:search:item
  1111. #-----------------------------------------------------------------------------
  1112. $ns = '__netjabber__:iq:search:item';
  1113. $NAMESPACES{$ns}->{Email}->{XPath}->{Path} = 'email/text()';
  1114. $NAMESPACES{$ns}->{First}->{XPath}->{Path} = 'first/text()';
  1115. $NAMESPACES{$ns}->{Family}->{XPath}->{Path} = 'family/text()';
  1116. $NAMESPACES{$ns}->{Given}->{XPath}->{Path} = 'given/text()';
  1117. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  1118. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  1119. $NAMESPACES{$ns}->{Key}->{XPath}->{Path} = 'key/text()';
  1120. $NAMESPACES{$ns}->{Last}->{XPath}->{Path} = 'last/text()';
  1121. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = 'name/text()';
  1122. $NAMESPACES{$ns}->{Nick}->{XPath}->{Path} = 'nick/text()';
  1123. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'master';
  1124. #-----------------------------------------------------------------------------
  1125. # jabber:iq:time
  1126. #-----------------------------------------------------------------------------
  1127. $ns = 'jabber:iq:time';
  1128. $NAMESPACES{$ns}->{Display}->{XPath}->{Type} = ['special','time-display'];
  1129. $NAMESPACES{$ns}->{Display}->{XPath}->{Path} = 'display/text()';
  1130. $NAMESPACES{$ns}->{Display}->{XPath}->{Calls} = ['Get','Set','Defined'];
  1131. $NAMESPACES{$ns}->{TZ}->{XPath}->{Type} = ['special','time-tz'];
  1132. $NAMESPACES{$ns}->{TZ}->{XPath}->{Path} = 'tz/text()';
  1133. $NAMESPACES{$ns}->{UTC}->{XPath}->{Type} = ['special','time-utc'];
  1134. $NAMESPACES{$ns}->{UTC}->{XPath}->{Path} = 'utc/text()';
  1135. $NAMESPACES{$ns}->{Time}->{XPath}->{Type} = ['master','all'];
  1136. $NAMESPACES{$ns}->{Time}->{XPath}->{Calls} = ['Get','Set'];
  1137. #-----------------------------------------------------------------------------
  1138. # jabber:iq:version
  1139. #-----------------------------------------------------------------------------
  1140. $ns = 'jabber:iq:version';
  1141. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = 'name/text()';
  1142. $NAMESPACES{$ns}->{OS}->{XPath}->{Type} = ['special','version-os'];
  1143. $NAMESPACES{$ns}->{OS}->{XPath}->{Path} = 'os/text()';
  1144. $NAMESPACES{$ns}->{Ver}->{XPath}->{Type} = ['special','version-version'];
  1145. $NAMESPACES{$ns}->{Ver}->{XPath}->{Path} = 'version/text()';
  1146. $NAMESPACES{$ns}->{Version}->{XPath}->{Type} = ['master','all'];
  1147. #-----------------------------------------------------------------------------
  1148. # http://jabber.org/protocol/bytestreams
  1149. #-----------------------------------------------------------------------------
  1150. $ns = 'http://jabber.org/protocol/bytestreams';
  1151. $NAMESPACES{$ns}->{Activate}->{XPath}->{Path} = 'activate/text()';
  1152. $NAMESPACES{$ns}->{StreamHostUsedJID}->{XPath}->{Type} = 'jid';
  1153. $NAMESPACES{$ns}->{StreamHostUsedJID}->{XPath}->{Path} = 'streamhost-used/@jid';
  1154. $NAMESPACES{$ns}->{SID}->{XPath}->{Path} = '@sid';
  1155. $NAMESPACES{$ns}->{StreamHost}->{XPath}->{Type} = 'node';
  1156. $NAMESPACES{$ns}->{StreamHost}->{XPath}->{Path} = 'streamhost';
  1157. $NAMESPACES{$ns}->{StreamHost}->{XPath}->{Child} = ['Query','__netjabber__:iq:bytestreams:streamhost'];
  1158. $NAMESPACES{$ns}->{StreamHost}->{XPath}->{Calls} = ['Add'];
  1159. $NAMESPACES{$ns}->{StreamHosts}->{XPath}->{Type} = 'children';
  1160. $NAMESPACES{$ns}->{StreamHosts}->{XPath}->{Path} = 'streamhost';
  1161. $NAMESPACES{$ns}->{StreamHosts}->{XPath}->{Child} = ['Query','__netjabber__:iq:bytestreams:streamhost'];
  1162. $NAMESPACES{$ns}->{StreamHosts}->{XPath}->{Calls} = ['Get'];
  1163. $NAMESPACES{$ns}->{ByteStreams}->{XPath}->{Type} = 'master';
  1164. #-----------------------------------------------------------------------------
  1165. # __netjabber__:iq:bytestreams:streamhost
  1166. #-----------------------------------------------------------------------------
  1167. $ns = '__netjabber__:iq:bytestreams:streamhost';
  1168. $NAMESPACES{$ns}->{Host}->{XPath}->{Path} = '@host';
  1169. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  1170. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  1171. $NAMESPACES{$ns}->{Port}->{XPath}->{Path} = '@port';
  1172. $NAMESPACES{$ns}->{ZeroConf}->{XPath}->{Path} = '@zeroconf';
  1173. $NAMESPACES{$ns}->{StreamHost}->{XPath}->{Type} = 'master';
  1174. #-----------------------------------------------------------------------------
  1175. # http://jabber.org/protocol/commands
  1176. #-----------------------------------------------------------------------------
  1177. $ns = 'http://jabber.org/protocol/commands';
  1178. $TAGS{$ns} = "command";
  1179. $NAMESPACES{$ns}->{Action}->{XPath}->{Path} = '@action';
  1180. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1181. $NAMESPACES{$ns}->{SessionID}->{XPath}->{Path} = '@sessionid';
  1182. $NAMESPACES{$ns}->{Status}->{XPath}->{Path} = '@status';
  1183. $NAMESPACES{$ns}->{Note}->{XPath}->{Type} = 'node';
  1184. $NAMESPACES{$ns}->{Note}->{XPath}->{Path} = 'note';
  1185. $NAMESPACES{$ns}->{Note}->{XPath}->{Child} = ['Query','__netjabber__:iq:commands:note'];
  1186. $NAMESPACES{$ns}->{Note}->{XPath}->{Calls} = ['Add'];
  1187. $NAMESPACES{$ns}->{Notes}->{XPath}->{Type} = 'children';
  1188. $NAMESPACES{$ns}->{Notes}->{XPath}->{Path} = 'note';
  1189. $NAMESPACES{$ns}->{Notes}->{XPath}->{Child} = ['Query','__netjabber__:iq:commands:note'];
  1190. $NAMESPACES{$ns}->{Notes}->{XPath}->{Calls} = ['Get'];
  1191. # xxx xml:lang
  1192. $NAMESPACES{$ns}->{Command}->{XPath}->{Type} = 'master';
  1193. #-----------------------------------------------------------------------------
  1194. # __netjabber__:iq:commands:note
  1195. #-----------------------------------------------------------------------------
  1196. $ns = '__netjabber__:iq:commands:note';
  1197. $NAMESPACES{$ns}->{Type}->{XPath}->{Path} = '@type';
  1198. $NAMESPACES{$ns}->{Message}->{XPath}->{Path} = 'text()';
  1199. $NAMESPACES{$ns}->{Note}->{XPath}->{Type} = 'master';
  1200. #-----------------------------------------------------------------------------
  1201. # http://jabber.org/protocol/disco#info
  1202. #-----------------------------------------------------------------------------
  1203. $ns = 'http://jabber.org/protocol/disco#info';
  1204. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1205. $NAMESPACES{$ns}->{Feature}->{XPath}->{Type} = 'node';
  1206. $NAMESPACES{$ns}->{Feature}->{XPath}->{Path} = 'feature';
  1207. $NAMESPACES{$ns}->{Feature}->{XPath}->{Child} = ['Query','__netjabber__:iq:disco:info:feature'];
  1208. $NAMESPACES{$ns}->{Feature}->{XPath}->{Calls} = ['Add'];
  1209. $NAMESPACES{$ns}->{Features}->{XPath}->{Type} = 'children';
  1210. $NAMESPACES{$ns}->{Features}->{XPath}->{Path} = 'feature';
  1211. $NAMESPACES{$ns}->{Features}->{XPath}->{Child} = ['Query','__netjabber__:iq:disco:info:feature'];
  1212. $NAMESPACES{$ns}->{Features}->{XPath}->{Calls} = ['Get'];
  1213. $NAMESPACES{$ns}->{Identity}->{XPath}->{Type} = 'node';
  1214. $NAMESPACES{$ns}->{Identity}->{XPath}->{Path} = 'identity';
  1215. $NAMESPACES{$ns}->{Identity}->{XPath}->{Child} = ['Query','__netjabber__:iq:disco:info:identity'];
  1216. $NAMESPACES{$ns}->{Identity}->{XPath}->{Calls} = ['Add'];
  1217. $NAMESPACES{$ns}->{Identities}->{XPath}->{Type} = 'children';
  1218. $NAMESPACES{$ns}->{Identities}->{XPath}->{Path} = 'identity';
  1219. $NAMESPACES{$ns}->{Identities}->{XPath}->{Child} = ['Query','__netjabber__:iq:disco:info:identity'];
  1220. $NAMESPACES{$ns}->{Identities}->{XPath}->{Calls} = ['Get'];
  1221. $NAMESPACES{$ns}->{DiscoInfo}->{XPath}->{Type} = 'master';
  1222. #-----------------------------------------------------------------------------
  1223. # __netjabber__:iq:disco:info:feature
  1224. #-----------------------------------------------------------------------------
  1225. $ns = '__netjabber__:iq:disco:info:feature';
  1226. $NAMESPACES{$ns}->{Var}->{XPath}->{Path} = '@var';
  1227. $NAMESPACES{$ns}->{Feature}->{XPath}->{Type} = 'master';
  1228. #-----------------------------------------------------------------------------
  1229. # __netjabber__:iq:disco:info:identity
  1230. #-----------------------------------------------------------------------------
  1231. $ns = '__netjabber__:iq:disco:info:identity';
  1232. $NAMESPACES{$ns}->{Category}->{XPath}->{Path} = '@category';
  1233. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = '@name';
  1234. $NAMESPACES{$ns}->{Type}->{XPath}->{Path} = '@type';
  1235. $NAMESPACES{$ns}->{Identity}->{XPath}->{Type} = 'master';
  1236. #-----------------------------------------------------------------------------
  1237. # http://jabber.org/protocol/disco#items
  1238. #-----------------------------------------------------------------------------
  1239. $ns = 'http://jabber.org/protocol/disco#items';
  1240. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1241. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'node';
  1242. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  1243. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:disco:items:item'];
  1244. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add'];
  1245. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'children';
  1246. $NAMESPACES{$ns}->{Items}->{XPath}->{Path} = 'item';
  1247. $NAMESPACES{$ns}->{Items}->{XPath}->{Child} = ['Query','__netjabber__:iq:disco:items:item'];
  1248. $NAMESPACES{$ns}->{Items}->{XPath}->{Calls} = ['Get'];
  1249. $NAMESPACES{$ns}->{DiscoItems}->{XPath}->{Type} = 'master';
  1250. #-----------------------------------------------------------------------------
  1251. # __netjabber__:iq:disco:items:item
  1252. #-----------------------------------------------------------------------------
  1253. $ns = '__netjabber__:iq:disco:items:item';
  1254. $NAMESPACES{$ns}->{Action}->{XPath}->{Path} = '@action';
  1255. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  1256. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  1257. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = '@name';
  1258. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1259. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'master';
  1260. #-----------------------------------------------------------------------------
  1261. # http://jabber.org/protocol/feature-neg
  1262. #-----------------------------------------------------------------------------
  1263. $ns = 'http://jabber.org/protocol/feature-neg';
  1264. $TAGS{$ns} = "feature";
  1265. $NAMESPACES{$ns}->{FeatureNeg}->{XPath}->{Type} = 'master';
  1266. #-----------------------------------------------------------------------------
  1267. # http://jabber.org/protocol/muc#admin
  1268. #-----------------------------------------------------------------------------
  1269. $ns = 'http://jabber.org/protocol/muc#admin';
  1270. $NAMESPACES{$ns}->{Admin}->{XPath}->{Type} = 'master';
  1271. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'node';
  1272. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  1273. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:muc:admin:item'];
  1274. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add'];
  1275. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'children';
  1276. $NAMESPACES{$ns}->{Items}->{XPath}->{Path} = 'item';
  1277. $NAMESPACES{$ns}->{Items}->{XPath}->{Child} = ['Query','__netjabber__:iq:muc:admin:item'];
  1278. $NAMESPACES{$ns}->{Items}->{XPath}->{Calls} = ['Get'];
  1279. #-----------------------------------------------------------------------------
  1280. # __netjabber__:iq:muc:admin:item
  1281. #-----------------------------------------------------------------------------
  1282. $ns = '__netjabber__:iq:muc:admin:item';
  1283. $NAMESPACES{$ns}->{ActorJID}->{XPath}->{Type} = 'jid';
  1284. $NAMESPACES{$ns}->{ActorJID}->{XPath}->{Path} = 'actor/@jid';
  1285. $NAMESPACES{$ns}->{Affiliation}->{XPath}->{Path} = '@affiliation';
  1286. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  1287. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  1288. $NAMESPACES{$ns}->{Nick}->{XPath}->{Path} = '@nick';
  1289. $NAMESPACES{$ns}->{Reason}->{XPath}->{Path} = 'reason/text()';
  1290. $NAMESPACES{$ns}->{Role}->{XPath}->{Path} = '@role';
  1291. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = "master";
  1292. #-----------------------------------------------------------------------------
  1293. # http://www.jabber.org/protocol/pubsub
  1294. #-----------------------------------------------------------------------------
  1295. $ns = 'http://www.jabber.org/protocol/pubsub';
  1296. $TAGS{$ns} = "pubsub";
  1297. $NAMESPACES{$ns}->{Affiliations}->{XPath}->{Type} = 'children';
  1298. $NAMESPACES{$ns}->{Affiliations}->{XPath}->{Path} = 'affiliations';
  1299. $NAMESPACES{$ns}->{Affiliations}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:affiliations'];
  1300. $NAMESPACES{$ns}->{Affiliations}->{XPath}->{Calls} = ['Add','Get'];
  1301. $NAMESPACES{$ns}->{Configure}->{XPath}->{Type} = 'children';
  1302. $NAMESPACES{$ns}->{Configure}->{XPath}->{Path} = 'configure';
  1303. $NAMESPACES{$ns}->{Configure}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:configure'];
  1304. $NAMESPACES{$ns}->{Configure}->{XPath}->{Calls} = ['Add','Get'];
  1305. $NAMESPACES{$ns}->{Create}->{XPath}->{Type} = 'children';
  1306. $NAMESPACES{$ns}->{Create}->{XPath}->{Path} = 'create';
  1307. $NAMESPACES{$ns}->{Create}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:create'];
  1308. $NAMESPACES{$ns}->{Create}->{XPath}->{Calls} = ['Add','Get'];
  1309. $NAMESPACES{$ns}->{Delete}->{XPath}->{Type} = 'children';
  1310. $NAMESPACES{$ns}->{Delete}->{XPath}->{Path} = 'delete';
  1311. $NAMESPACES{$ns}->{Delete}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:delete'];
  1312. $NAMESPACES{$ns}->{Delete}->{XPath}->{Calls} = ['Add','Get'];
  1313. $NAMESPACES{$ns}->{Entities}->{XPath}->{Type} = 'children';
  1314. $NAMESPACES{$ns}->{Entities}->{XPath}->{Path} = 'entities';
  1315. $NAMESPACES{$ns}->{Entities}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:entities'];
  1316. $NAMESPACES{$ns}->{Entities}->{XPath}->{Calls} = ['Add','Get'];
  1317. $NAMESPACES{$ns}->{Entity}->{XPath}->{Type} = 'children';
  1318. $NAMESPACES{$ns}->{Entity}->{XPath}->{Path} = 'entity';
  1319. $NAMESPACES{$ns}->{Entity}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:entity'];
  1320. $NAMESPACES{$ns}->{Entity}->{XPath}->{Calls} = ['Add','Get'];
  1321. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'children';
  1322. $NAMESPACES{$ns}->{Items}->{XPath}->{Path} = 'items';
  1323. $NAMESPACES{$ns}->{Items}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:items'];
  1324. $NAMESPACES{$ns}->{Items}->{XPath}->{Calls} = ['Add','Get'];
  1325. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'children';
  1326. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  1327. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:item'];
  1328. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add','Get'];
  1329. $NAMESPACES{$ns}->{Options}->{XPath}->{Type} = 'children';
  1330. $NAMESPACES{$ns}->{Options}->{XPath}->{Path} = 'options';
  1331. $NAMESPACES{$ns}->{Options}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:options'];
  1332. $NAMESPACES{$ns}->{Options}->{XPath}->{Calls} = ['Add','Get'];
  1333. $NAMESPACES{$ns}->{Publish}->{XPath}->{Type} = 'children';
  1334. $NAMESPACES{$ns}->{Publish}->{XPath}->{Path} = 'publish';
  1335. $NAMESPACES{$ns}->{Publish}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:publish'];
  1336. $NAMESPACES{$ns}->{Publish}->{XPath}->{Calls} = ['Add','Get'];
  1337. $NAMESPACES{$ns}->{Purge}->{XPath}->{Type} = 'children';
  1338. $NAMESPACES{$ns}->{Purge}->{XPath}->{Path} = 'purge';
  1339. $NAMESPACES{$ns}->{Purge}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:purge'];
  1340. $NAMESPACES{$ns}->{Purge}->{XPath}->{Calls} = ['Add','Get'];
  1341. $NAMESPACES{$ns}->{Retract}->{XPath}->{Type} = 'children';
  1342. $NAMESPACES{$ns}->{Retract}->{XPath}->{Path} = 'retract';
  1343. $NAMESPACES{$ns}->{Retract}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:retract'];
  1344. $NAMESPACES{$ns}->{Retract}->{XPath}->{Calls} = ['Add','Get'];
  1345. $NAMESPACES{$ns}->{Subscribe}->{XPath}->{Type} = 'children';
  1346. $NAMESPACES{$ns}->{Subscribe}->{XPath}->{Path} = 'subscribe';
  1347. $NAMESPACES{$ns}->{Subscribe}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:subscribe'];
  1348. $NAMESPACES{$ns}->{Subscribe}->{XPath}->{Calls} = ['Add','Get'];
  1349. $NAMESPACES{$ns}->{Unsubscribe}->{XPath}->{Type} = 'children';
  1350. $NAMESPACES{$ns}->{Unsubscribe}->{XPath}->{Path} = 'unsubscribe';
  1351. $NAMESPACES{$ns}->{Unsubscribe}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:unsubscribe'];
  1352. $NAMESPACES{$ns}->{Unsubscribe}->{XPath}->{Calls} = ['Add','Get'];
  1353. $NAMESPACES{$ns}->{PubSub}->{XPath}->{Type} = 'master';
  1354. #-----------------------------------------------------------------------------
  1355. # __netjabber__:iq:pubsub:affiliations
  1356. #-----------------------------------------------------------------------------
  1357. $ns = '__netjabber__:iq:pubsub:affiliations';
  1358. $NAMESPACES{$ns}->{Entity}->{XPath}->{Type} = 'children';
  1359. $NAMESPACES{$ns}->{Entity}->{XPath}->{Path} = 'entity';
  1360. $NAMESPACES{$ns}->{Entity}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:entity'];
  1361. $NAMESPACES{$ns}->{Entity}->{XPath}->{Calls} = ['Add','Get'];
  1362. $NAMESPACES{$ns}->{Affiliations}->{XPath}->{Type} = 'master';
  1363. #-----------------------------------------------------------------------------
  1364. # __netjabber__:iq:pubsub:configure
  1365. #-----------------------------------------------------------------------------
  1366. $ns = '__netjabber__:iq:pubsub:configure';
  1367. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1368. $NAMESPACES{$ns}->{Configure}->{XPath}->{Type} = 'master';
  1369. #-----------------------------------------------------------------------------
  1370. # __netjabber__:iq:pubsub:create
  1371. #-----------------------------------------------------------------------------
  1372. $ns = '__netjabber__:iq:pubsub:create';
  1373. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1374. $NAMESPACES{$ns}->{Create}->{XPath}->{Type} = 'master';
  1375. #-----------------------------------------------------------------------------
  1376. # __netjabber__:iq:pubsub:delete
  1377. #-----------------------------------------------------------------------------
  1378. $ns = '__netjabber__:iq:pubsub:delete';
  1379. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1380. $NAMESPACES{$ns}->{Delete}->{XPath}->{Type} = 'master';
  1381. #-----------------------------------------------------------------------------
  1382. # __netjabber__:iq:pubsub:entities
  1383. #-----------------------------------------------------------------------------
  1384. $ns = '__netjabber__:iq:pubsub:entities';
  1385. $NAMESPACES{$ns}->{Entity}->{XPath}->{Type} = 'children';
  1386. $NAMESPACES{$ns}->{Entity}->{XPath}->{Path} = 'entity';
  1387. $NAMESPACES{$ns}->{Entity}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:entity'];
  1388. $NAMESPACES{$ns}->{Entity}->{XPath}->{Calls} = ['Add','Get'];
  1389. $NAMESPACES{$ns}->{Entities}->{XPath}->{Type} = 'master';
  1390. #-----------------------------------------------------------------------------
  1391. # __netjabber__:iq:pubsub:entity
  1392. #-----------------------------------------------------------------------------
  1393. $ns = '__netjabber__:iq:pubsub:entity';
  1394. $NAMESPACES{$ns}->{Affiliation}->{XPath}->{Path} = '@affiliation';
  1395. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  1396. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  1397. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1398. $NAMESPACES{$ns}->{Subscription}->{XPath}->{Path} = '@subscription';
  1399. $NAMESPACES{$ns}->{SubscribeOptions}->{XPath}->{Type} = 'children';
  1400. $NAMESPACES{$ns}->{SubscribeOptions}->{XPath}->{Path} = 'subscribe-options';
  1401. $NAMESPACES{$ns}->{SubscribeOptions}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:subscribe-options'];
  1402. $NAMESPACES{$ns}->{SubscribeOptions}->{XPath}->{Calls} = ['Add','Get'];
  1403. $NAMESPACES{$ns}->{Entity}->{XPath}->{Type} = 'master';
  1404. #-----------------------------------------------------------------------------
  1405. # __netjabber__:iq:pubsub:items
  1406. #-----------------------------------------------------------------------------
  1407. $ns = '__netjabber__:iq:pubsub:items';
  1408. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'children';
  1409. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  1410. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:item'];
  1411. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add','Get'];
  1412. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1413. $NAMESPACES{$ns}->{MaxItems}->{XPath}->{Path} = '@max_items';
  1414. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'master';
  1415. #-----------------------------------------------------------------------------
  1416. # __netjabber__:iq:pubsub:item
  1417. #-----------------------------------------------------------------------------
  1418. $ns = '__netjabber__:iq:pubsub:item';
  1419. $NAMESPACES{$ns}->{ID}->{XPath}->{Path} = '@id';
  1420. $NAMESPACES{$ns}->{Payload}->{XPath}->{Type} = 'raw';
  1421. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'master';
  1422. #-----------------------------------------------------------------------------
  1423. # __netjabber__:iq:pubsub:options
  1424. #-----------------------------------------------------------------------------
  1425. $ns = '__netjabber__:iq:pubsub:options';
  1426. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  1427. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  1428. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1429. $NAMESPACES{$ns}->{Options}->{XPath}->{Type} = 'master';
  1430. #-----------------------------------------------------------------------------
  1431. # __netjabber__:iq:pubsub:publish
  1432. #-----------------------------------------------------------------------------
  1433. $ns = '__netjabber__:iq:pubsub:publish';
  1434. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'children';
  1435. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  1436. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:item'];
  1437. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add','Get'];
  1438. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1439. $NAMESPACES{$ns}->{Publish}->{XPath}->{Type} = 'master';
  1440. #-----------------------------------------------------------------------------
  1441. # __netjabber__:iq:pubsub:purge
  1442. #-----------------------------------------------------------------------------
  1443. $ns = '__netjabber__:iq:pubsub:purge';
  1444. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1445. $NAMESPACES{$ns}->{Purge}->{XPath}->{Type} = 'master';
  1446. #-----------------------------------------------------------------------------
  1447. # __netjabber__:iq:pubsub:retract
  1448. #-----------------------------------------------------------------------------
  1449. $ns = '__netjabber__:iq:pubsub:retract';
  1450. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'children';
  1451. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  1452. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:item'];
  1453. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add','Get'];
  1454. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1455. $NAMESPACES{$ns}->{Retract}->{XPath}->{Type} = 'master';
  1456. #-----------------------------------------------------------------------------
  1457. # __netjabber__:iq:pubsub:subscribe
  1458. #-----------------------------------------------------------------------------
  1459. $ns = '__netjabber__:iq:pubsub:subscribe';
  1460. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  1461. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  1462. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1463. $NAMESPACES{$ns}->{Subscribe}->{XPath}->{Type} = 'master';
  1464. #-----------------------------------------------------------------------------
  1465. # __netjabber__:iq:pubsub:subscribe-options
  1466. #-----------------------------------------------------------------------------
  1467. $ns = '__netjabber__:iq:pubsub:subscribe-options';
  1468. $NAMESPACES{$ns}->{Required}->{XPath}->{Type} = 'flag';
  1469. $NAMESPACES{$ns}->{Required}->{XPath}->{Path} = 'required';
  1470. $NAMESPACES{$ns}->{SubscribeOptions}->{XPath}->{Type} = 'master';
  1471. #-----------------------------------------------------------------------------
  1472. # __netjabber__:iq:pubsub:unsubscribe
  1473. #-----------------------------------------------------------------------------
  1474. $ns = '__netjabber__:iq:pubsub:unsubscribe';
  1475. $NAMESPACES{$ns}->{JID}->{XPath}->{Type} = 'jid';
  1476. $NAMESPACES{$ns}->{JID}->{XPath}->{Path} = '@jid';
  1477. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1478. $NAMESPACES{$ns}->{Unsubscribe}->{XPath}->{Type} = 'master';
  1479. #-----------------------------------------------------------------------------
  1480. # http://www.jabber.org/protocol/pubsub#event
  1481. #-----------------------------------------------------------------------------
  1482. $ns = 'http://www.jabber.org/protocol/pubsub#event';
  1483. $TAGS{$ns} = "event";
  1484. $NAMESPACES{$ns}->{Delete}->{XPath}->{Type} = 'children';
  1485. $NAMESPACES{$ns}->{Delete}->{XPath}->{Path} = 'delete';
  1486. $NAMESPACES{$ns}->{Delete}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:event:delete'];
  1487. $NAMESPACES{$ns}->{Delete}->{XPath}->{Calls} = ['Add','Get'];
  1488. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'children';
  1489. $NAMESPACES{$ns}->{Items}->{XPath}->{Path} = 'items';
  1490. $NAMESPACES{$ns}->{Items}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:event:items'];
  1491. $NAMESPACES{$ns}->{Items}->{XPath}->{Calls} = ['Add','Get'];
  1492. $NAMESPACES{$ns}->{Event}->{XPath}->{Type} = 'master';
  1493. #-----------------------------------------------------------------------------
  1494. # __netjabber__:iq:pubsub:event:delete
  1495. #-----------------------------------------------------------------------------
  1496. $ns = '__netjabber__:iq:pubsub:event:delete';
  1497. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1498. $NAMESPACES{$ns}->{Delete}->{XPath}->{Type} = 'master';
  1499. #-----------------------------------------------------------------------------
  1500. # __netjabber__:iq:pubsub:event:items
  1501. #-----------------------------------------------------------------------------
  1502. $ns = '__netjabber__:iq:pubsub:event:items';
  1503. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'children';
  1504. $NAMESPACES{$ns}->{Item}->{XPath}->{Path} = 'item';
  1505. $NAMESPACES{$ns}->{Item}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:event:item'];
  1506. $NAMESPACES{$ns}->{Item}->{XPath}->{Calls} = ['Add','Get'];
  1507. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1508. $NAMESPACES{$ns}->{Items}->{XPath}->{Type} = 'master';
  1509. #-----------------------------------------------------------------------------
  1510. # __netjabber__:iq:pubsub:event:item
  1511. #-----------------------------------------------------------------------------
  1512. $ns = '__netjabber__:iq:pubsub:event:item';
  1513. $NAMESPACES{$ns}->{ID}->{XPath}->{Path} = '@id';
  1514. $NAMESPACES{$ns}->{Payload}->{XPath}->{Type} = 'raw';
  1515. $NAMESPACES{$ns}->{Item}->{XPath}->{Type} = 'master';
  1516. #-----------------------------------------------------------------------------
  1517. # http://www.jabber.org/protocol/pubsub#owner
  1518. #-----------------------------------------------------------------------------
  1519. $ns = 'http://www.jabber.org/protocol/pubsub#owner';
  1520. $TAGS{$ns} = "pubsub";
  1521. $NAMESPACES{$ns}->{Action}->{XPath}->{Path} = '@action';
  1522. $NAMESPACES{$ns}->{Configure}->{XPath}->{Type} = 'children';
  1523. $NAMESPACES{$ns}->{Configure}->{XPath}->{Path} = 'configure';
  1524. $NAMESPACES{$ns}->{Configure}->{XPath}->{Child} = ['Query','__netjabber__:iq:pubsub:owner:configure'];
  1525. $NAMESPACES{$ns}->{Configure}->{XPath}->{Calls} = ['Add','Get'];
  1526. $NAMESPACES{$ns}->{Owner}->{XPath}->{Type} = 'master';
  1527. #-----------------------------------------------------------------------------
  1528. # __netjabber__:iq:pubsub:owner:configure
  1529. #-----------------------------------------------------------------------------
  1530. $ns = '__netjabber__:iq:pubsub:owner:configure';
  1531. $NAMESPACES{$ns}->{Node}->{XPath}->{Path} = '@node';
  1532. $NAMESPACES{$ns}->{Configure}->{XPath}->{Type} = 'master';
  1533. #-----------------------------------------------------------------------------
  1534. # http://jabber.org/protocol/si
  1535. #-----------------------------------------------------------------------------
  1536. $ns = 'http://jabber.org/protocol/si';
  1537. $TAGS{$ns} = "si";
  1538. $NAMESPACES{$ns}->{ID}->{XPath}->{Path} = '@id';
  1539. $NAMESPACES{$ns}->{MimeType}->{XPath}->{Path} = '@mime-type';
  1540. $NAMESPACES{$ns}->{Profile}->{XPath}->{Path} = '@profile';
  1541. $NAMESPACES{$ns}->{Stream}->{XPath}->{Type} = 'master';
  1542. #-----------------------------------------------------------------------------
  1543. # http://jabber.org/protocol/si/profile/file-transfer
  1544. #-----------------------------------------------------------------------------
  1545. $ns = 'http://jabber.org/protocol/si/profile/file-transfer';
  1546. $TAGS{$ns} = "file";
  1547. $NAMESPACES{$ns}->{Date}->{XPath}->{Path} = '@date';
  1548. $NAMESPACES{$ns}->{Desc}->{XPath}->{Path} = 'desc/text()';
  1549. $NAMESPACES{$ns}->{Hash}->{XPath}->{Path} = '@hash';
  1550. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = '@name';
  1551. $NAMESPACES{$ns}->{Range}->{XPath}->{Type} = 'flag';
  1552. $NAMESPACES{$ns}->{Range}->{XPath}->{Path} = 'range';
  1553. $NAMESPACES{$ns}->{RangeOffset}->{XPath}->{Path} = 'range/@offset';
  1554. $NAMESPACES{$ns}->{RangeLength}->{XPath}->{Path} = 'range/@length';
  1555. $NAMESPACES{$ns}->{Size}->{XPath}->{Path} = '@size';
  1556. $NAMESPACES{$ns}->{File}->{XPath}->{Type} = 'master';
  1557. #-----------------------------------------------------------------------------
  1558. # http://jabber.org/protocol/si/profile/tree-transfer
  1559. #-----------------------------------------------------------------------------
  1560. $ns = 'http://jabber.org/protocol/si/profile/tree-transfer';
  1561. $TAGS{$ns} = "tree";
  1562. $NAMESPACES{$ns}->{Directory}->{XPath}->{Type} = 'children';
  1563. $NAMESPACES{$ns}->{Directory}->{XPath}->{Path} = 'directory';
  1564. $NAMESPACES{$ns}->{Directory}->{XPath}->{Child} = ['Query','__netjabber__:iq:si:profile:tree:directory'];
  1565. $NAMESPACES{$ns}->{Directory}->{XPath}->{Calls} = ['Add','Get'];
  1566. $NAMESPACES{$ns}->{Numfiles}->{XPath}->{Path} = '@numfiles';
  1567. $NAMESPACES{$ns}->{Size}->{XPath}->{Path} = '@size';
  1568. $NAMESPACES{$ns}->{Tree}->{XPath}->{Type} = 'master';
  1569. #-----------------------------------------------------------------------------
  1570. # __netjabber__:iq:si:profile:tree:directory
  1571. #-----------------------------------------------------------------------------
  1572. $ns = '__netjabber__:iq:si:profile:tree:directory';
  1573. $NAMESPACES{$ns}->{Directory}->{XPath}->{Type} = 'children';
  1574. $NAMESPACES{$ns}->{Directory}->{XPath}->{Path} = 'directory';
  1575. $NAMESPACES{$ns}->{Directory}->{XPath}->{Child} = ['Query','__netjabber__:iq:si:profile:tree:directory'];
  1576. $NAMESPACES{$ns}->{Directory}->{XPath}->{Calls} = ['Add','Get'];
  1577. $NAMESPACES{$ns}->{File}->{XPath}->{Type} = 'children';
  1578. $NAMESPACES{$ns}->{File}->{XPath}->{Path} = 'file';
  1579. $NAMESPACES{$ns}->{File}->{XPath}->{Child} = ['Query','__netjabber__:iq:si:profile:tree:file'];
  1580. $NAMESPACES{$ns}->{File}->{XPath}->{Calls} = ['Add','Get'];
  1581. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = '@name';
  1582. $NAMESPACES{$ns}->{Dir}->{XPath}->{Type} = 'master';
  1583. #-----------------------------------------------------------------------------
  1584. # __netjabber__:iq:si:profile:tree:file
  1585. #-----------------------------------------------------------------------------
  1586. $ns = '__netjabber__:iq:si:profile:tree:file';
  1587. $NAMESPACES{$ns}->{Name}->{XPath}->{Path} = '@name';
  1588. $NAMESPACES{$ns}->{SID}->{XPath}->{Path} = '@sid';
  1589. $NAMESPACES{$ns}->{File}->{XPath}->{Type} = 'master';
  1590. #-----------------------------------------------------------------------------
  1591. # http://www.jabber.org/protocol/soap
  1592. #-----------------------------------------------------------------------------
  1593. $ns = 'http://www.jabber.org/protocol/soap';
  1594. $TAGS{$ns} = "soap";
  1595. $NAMESPACES{$ns}->{Payload}->{XPath}->{Type} = 'raw';
  1596. $NAMESPACES{$ns}->{Soap}->{XPath}->{Type} = 'master';
  1597. #-----------------------------------------------------------------------------
  1598. # XMPP-Bind
  1599. #-----------------------------------------------------------------------------
  1600. $ns = &XML::Stream::ConstXMLNS("xmpp-bind");
  1601. $TAGS{$ns} = "bind";
  1602. $NAMESPACES{$ns}->{Resource}->{XPath}->{Path} = 'resource/text()';
  1603. $NAMESPACES{$ns}->{Bind}->{XPath}->{Type} = 'master';
  1604. #-----------------------------------------------------------------------------
  1605. # XMPP-Session
  1606. #-----------------------------------------------------------------------------
  1607. $ns = &XML::Stream::ConstXMLNS("xmpp-session");
  1608. $TAGS{$ns} = "session";
  1609. $NAMESPACES{$ns}->{Session}->{XPath}->{Type} = 'master';
  1610. ##############################################################################
  1611. #
  1612. # GetResults - helper function for jabber:iq:search to easily get the items
  1613. # back in a hash format.
  1614. #
  1615. ##############################################################################
  1616. sub GetResults
  1617. {
  1618. my $self = shift;
  1619. my %results;
  1620. foreach my $item ($self->GetItems())
  1621. {
  1622. my %result;
  1623. my @xData = $item->GetX("jabber:x:data");
  1624. if ($#xData == -1)
  1625. {
  1626. %result = $item->GetItem();
  1627. }
  1628. else
  1629. {
  1630. foreach my $field ($xData[0]->GetFields())
  1631. {
  1632. $result{$field->GetVar()} = $field->GetValue();
  1633. }
  1634. }
  1635. $results{$item->GetJID()} = \%result;
  1636. }
  1637. return %results;
  1638. }
  1639. 1;