XML-Stream-1.24000755001750001750 012446075370 14430 5ustar00dapatrickdapatrick000000000000XML-Stream-1.24/META.yml000444001750001750 467112446075370 16046 0ustar00dapatrickdapatrick000000000000--- abstract: 'XML stream support library for XMPP-like protocols' author: - 'Darian Anthony Patrick ' build_requires: Test::More: '0.92' configure_requires: Module::Build: '0.360300' dynamic_config: 1 generated_by: 'Module::Build version 0.4205, CPAN::Meta::Converter version 2.141170' license: lgpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: XML-Stream provides: XML::Stream: file: lib/XML/Stream.pm version: '1.24' XML::Stream::IO::Select::Win32: file: lib/XML/Stream/IO/Select/Win32.pm version: '1.24' XML::Stream::Namespace: file: lib/XML/Stream/Namespace.pm version: '1.24' XML::Stream::Node: file: lib/XML/Stream/Node.pm version: '1.24' XML::Stream::Parser: file: lib/XML/Stream/Parser.pm version: '1.24' XML::Stream::Parser::DTD: file: lib/XML/Stream/Parser/DTD.pm version: '1.24' XML::Stream::Tools: file: lib/XML/Stream/Tools.pm XML::Stream::Tree: file: lib/XML/Stream/Tree.pm version: '1.24' XML::Stream::XPath: file: lib/XML/Stream/XPath.pm version: '1.24' XML::Stream::XPath::AllOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::AndOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::AttributeOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::ContextOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::EqualOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::FunctionOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::NodeOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::NotEqualOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::Op: file: lib/XML/Stream/XPath/Op.pm version: '1.24' XML::Stream::XPath::OrOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::PositionOp: file: lib/XML/Stream/XPath/Op.pm XML::Stream::XPath::Query: file: lib/XML/Stream/XPath/Query.pm version: '1.24' XML::Stream::XPath::Value: file: lib/XML/Stream/XPath/Value.pm version: '1.24' requires: Authen::SASL: '0' Carp: '0' Encode: '0' FileHandle: '0' IO::Select: '0' IO::Socket: '0' MIME::Base64: '0' POSIX: '0' Scalar::Util: '0' Sys::Hostname: '0' perl: v5.8.0 utf8: '0' resources: bugtracker: https://github.com/dap/XML-Stream/issues license: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt repository: https://github.com/dap/XML-Stream version: '1.24' XML-Stream-1.24/README000444001750001750 137512446075370 15453 0ustar00dapatrickdapatrick000000000000XML::Stream v1.24 2014-12-22 This module provides you with access to XML Streams. An XML Stream is just that. A stream of XML over a connection between two computers. For more information about XML Streams, and the group that created them, please visit: http://xmpp.org/protocols/streams/ Darian Anthony Patrick dapatrick@cpan.org INSTALLATION perl Makefile.PL make make install REQUIREMENTS Perl 5.8.0 - For unicode support Authen::SASL - For SASL Authentication MIME::Base64 - For SASL Authentication RECOMMENDATIONS IO::Socket::SSL v0.81 - Module to enable TLS for XML::Stream. Net::DNS - Enables access to SRV records. Please submit bug reports at https://github.com/dap/XML-Stream/issues XML-Stream-1.24/MANIFEST000444001750001750 117112446075370 15716 0ustar00dapatrickdapatrick000000000000Build.PL CHANGES INFO lib/XML/Stream.pm lib/XML/Stream/IO/Select/Win32.pm lib/XML/Stream/Namespace.pm lib/XML/Stream/Node.pm lib/XML/Stream/Parser.pm lib/XML/Stream/Parser/DTD.pm lib/XML/Stream/Tools.pm lib/XML/Stream/Tree.pm lib/XML/Stream/XPath.pm lib/XML/Stream/XPath/Op.pm lib/XML/Stream/XPath/Query.pm lib/XML/Stream/XPath/Value.pm LICENSE Makefile.PL MANIFEST This list of files META.json META.yml README t/0-signature.t t/buildxml.t t/cdata.t t/load.t t/memory_cycle.t t/net_xmpp.t t/parse_node.t t/parse_tree.t t/quotes.t t/tcpip.t t/tcpip2ssl.t t/test.xml t/xml2config.t t/xpath.t SIGNATURE Added here by Module::Build XML-Stream-1.24/Makefile.PL000444001750001750 137212446075370 16542 0ustar00dapatrickdapatrick000000000000# Note: this file was auto-generated by Module::Build::Compat version 0.4205 require 5.008000; use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'XML::Stream', 'VERSION_FROM' => 'lib/XML/Stream.pm', 'PREREQ_PM' => { 'Authen::SASL' => 0, 'Carp' => 0, 'Encode' => 0, 'FileHandle' => 0, 'IO::Select' => 0, 'IO::Socket' => 0, 'MIME::Base64' => 0, 'POSIX' => 0, 'Scalar::Util' => 0, 'Sys::Hostname' => 0, 'Test::More' => '0.92', 'utf8' => 0 }, 'INSTALLDIRS' => 'site', 'EXE_FILES' => [], 'PL_FILES' => {} ) ; XML-Stream-1.24/LICENSE000444001750001750 6016012446075370 15615 0ustar00dapatrickdapatrick000000000000This software is Copyright (c) 2014 by Darian Anthony Patrick . This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 The GNU Lesser General Public License (LGPL) Version 2.1, February 1999 (The master copy of this license lives on the GNU website.) Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS XML-Stream-1.24/META.json000444001750001750 731312446075370 16212 0ustar00dapatrickdapatrick000000000000{ "abstract" : "XML stream support library for XMPP-like protocols", "author" : [ "Darian Anthony Patrick " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.4205", "license" : [ "lgpl_2_1" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "XML-Stream", "prereqs" : { "build" : { "requires" : { "Test::More" : "0.92" } }, "configure" : { "requires" : { "Module::Build" : "0.360300" } }, "runtime" : { "requires" : { "Authen::SASL" : "0", "Carp" : "0", "Encode" : "0", "FileHandle" : "0", "IO::Select" : "0", "IO::Socket" : "0", "MIME::Base64" : "0", "POSIX" : "0", "Scalar::Util" : "0", "Sys::Hostname" : "0", "perl" : "v5.8.0", "utf8" : "0" } } }, "provides" : { "XML::Stream" : { "file" : "lib/XML/Stream.pm", "version" : "1.24" }, "XML::Stream::IO::Select::Win32" : { "file" : "lib/XML/Stream/IO/Select/Win32.pm", "version" : "1.24" }, "XML::Stream::Namespace" : { "file" : "lib/XML/Stream/Namespace.pm", "version" : "1.24" }, "XML::Stream::Node" : { "file" : "lib/XML/Stream/Node.pm", "version" : "1.24" }, "XML::Stream::Parser" : { "file" : "lib/XML/Stream/Parser.pm", "version" : "1.24" }, "XML::Stream::Parser::DTD" : { "file" : "lib/XML/Stream/Parser/DTD.pm", "version" : "1.24" }, "XML::Stream::Tools" : { "file" : "lib/XML/Stream/Tools.pm" }, "XML::Stream::Tree" : { "file" : "lib/XML/Stream/Tree.pm", "version" : "1.24" }, "XML::Stream::XPath" : { "file" : "lib/XML/Stream/XPath.pm", "version" : "1.24" }, "XML::Stream::XPath::AllOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::AndOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::AttributeOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::ContextOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::EqualOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::FunctionOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::NodeOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::NotEqualOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::Op" : { "file" : "lib/XML/Stream/XPath/Op.pm", "version" : "1.24" }, "XML::Stream::XPath::OrOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::PositionOp" : { "file" : "lib/XML/Stream/XPath/Op.pm" }, "XML::Stream::XPath::Query" : { "file" : "lib/XML/Stream/XPath/Query.pm", "version" : "1.24" }, "XML::Stream::XPath::Value" : { "file" : "lib/XML/Stream/XPath/Value.pm", "version" : "1.24" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/dap/XML-Stream/issues" }, "license" : [ "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt" ], "repository" : { "url" : "https://github.com/dap/XML-Stream" } }, "version" : "1.24" } XML-Stream-1.24/Build.PL000444001750001750 174312446075370 16066 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Module::Build; my $build = Module::Build->new( module_name => 'XML::Stream', license => 'lgpl', dist_author => 'Darian Anthony Patrick ', dist_abstract => 'XML stream support library for XMPP-like protocols', configure_requires => { 'Module::Build' => '0.360300', }, build_requires => { 'Test::More' => '0.92', }, requires => { 'perl' => 'v5.8.0', 'Authen::SASL' => 0, 'Carp' => 0, 'Encode' => 0, 'FileHandle' => 0, 'IO::Select' => 0, 'IO::Socket' => 0, 'MIME::Base64' => 0, 'POSIX' => 0, 'Sys::Hostname' => 0, 'utf8' => 0, 'Scalar::Util' => 0, }, sign => 1, create_license => 1, create_makefile_pl => 'traditional', meta_merge => { 'resources' => { 'bugtracker' => 'https://github.com/dap/XML-Stream/issues', 'repository' => 'https://github.com/dap/XML-Stream', } }, ); $build->create_build_script; XML-Stream-1.24/CHANGES000444001750001750 2452712446075370 15612 0ustar00dapatrickdapatrick0000000000001.24 2014-12-22 ==== - Roll-up of all 1.23_* changes - Update bug tracker location 1.23_07 2014-12-17 ==== - Correct incorrectly tagged 1.23_06 (errantly tagged as 1.24_06) 1.23_06 2011-07-19 ==== - Eliminate another set of cyclic references (szabgab) - Stylistic improvements in tests (szabgab) - Refactor debug output to separate module (szabgab) - Weaken scalar references to address additional memory leak (szabgab) - Add additional tests for scalar references (szabgab) - Documentation format corrections (szabgab) 1.23_05 2011-06-23 ==== - RT#8834 unindented POD so that it reformats properly (szabgab) - Weaken cyclic references in XML::Stream to eliminate memory leak (szabgab) - Increase use of warnings and strictures in tests and code (szabgab) - Replace indirect object notation with direct invocation notation (szabgab) - Replace manual TAP output with Test::More (szabgab) 1.23_04 2010-09-22 ==== - RT#57649 Set default value for _tls flag - Module metadata changes 1.23_03 2010-09-20 ==== - RT#57649 Prepare cert verification params when TLS connection is requested 1.23_02 2010-09-18 ==== - Convert project to Module::Build, with ExtUtils::MakeMaker compatibility - RT#57649 SSL cert verification, enabled by default - RT#53315 Remove old, bundled Test::* libraries, now core - RT#54880 Clarify license terms - RT#54151 Disable network-based tests via environment variable (for Debian) - RT#56574 Fix object construction causing problems on Perl 5.12.0 1.23 ==== - New maintainer: DAPATRICK - RT#17484 Handle servers which re-use stream ID - RT#18711 Update link to XML Streams doc - RT#12977 Require perl >= 5.8.0 - RT#19415 Use jabber.org for tests - RT#21932 Fix authname for Google Talk SASL auth - RT#39098 Make dependencies more explicit - RT#24817 Merge and massage of toddr's SASL fix - RT#36864 Fake select on filehandles on win32 - RT#31215 Test and fix for XML node copying issue - RT#17325 Fix and test for infinite loop on quotes 1.23_01 ==== * Version 1.23_01 was errantly published as a pre-release of 1.23 1.22 ==== - Using Encode module to handle utf encoding and decoding. I cannot just put the socket into utf8 because IO::Socket::SSL does not support binmode. So I'm calling decode_utf8() before returning the Read string, and encode_utf8() before writing the Send string. - Fixed SASL PLAIN authentication. 1.21 ==== - Sigh... Screwed up the CPAN release... again... 1.20 ==== - Ok... dang it. Another minor tweak to fix CPAN. 1.19 ==== - Minor release bug. Forgot to include the prereqs for Authen::SASL and MIME::Base4. 1.18 ==== - Added initial cut at XMPP 1.0 support. - Fixed timeout for Connect(). It was horribly broken and in efficient. Thanks to Jesper Krogh. - Added timeout to socket creation. 1.17 ==== - Added patch to make the Process a little faster by putting the sleeps into the can_read() calls so that you don't have to delay even a few micro seconds when you get new XML. (Evan Prodromou) - Added SRV lookup support for Connect via Net::DNS. - Changed the select calls when blocking to can_read calls so that we can wake up when there is data, and not just after a certain period of time. Thanks to Evan Prodromou. - Interesting bug with Broken Pipes. 1.16 ==== - Upgraded the XPath engine to a more extensible and robust design. - To get tests to work 100% I have to get better determination on the BuildXML functions. So fomr this point on, all attributes are printed in alphabetical order. - Fixed bug in Parser with not being supported. - Changed BuildXML for Tree. You have to pass it a ref and not an array. That was to make the rawXML thing work better. - Added the ability to add raw XML at the BuildXML call. - Added remove_cdata method to Node. - Added methods to Node to make calls easier (XPath, GetXML). 1.15 ==== - Added XPath function and support for most of the abbreviated xpaths. - Added new XML::Stream::Node type. This behaves more like a you would think an XML node would behave. - Added a NONBLOCKING variable to control if the parser blocks or does not block. This might cause some problems, but it also might open some new doors. We will see. - Upped buffer size by 4x for second party fix. - Added code to handle tracking the last activity. - Fixed Disconnect bug where is would not clean up the environment well enough. - Added check for version of IO::Socket::SSL since it is not a required module. - Added check before trying to convert a socket to SSL. - Removed some warnings about unintialized strings. - Added tests for make test. 1.14 ==== - Fixed slow execution due to a sleep where there shouldn't be a sleep. - Added OpenFile() way to parse a stream. It takes the same kind of arguments that open() takes, so you can parse the stream output from a command or a file and pretend that it's a stream. It will ignore the outer most tag and pretend that it's a tag. - Fixed documentation to reflect the SID. - Get "value array" with attrib fetches the same attrib from the macthing nodes. 1.13 ==== - Fixed bug in Parser with entities getting split by reads and not interpreted properly. - Moved IO::Select requirement to 1.13 per a bug report from datawrangler. - Added XML2Config function to handle parsing config.xml files. - Fixed bug in the Parser parse and parsefile functions. 1.12 ==== - Fixed SSL bug. - Added support for the new HTTP::ProxyAutoConfig from Netscape. - Fixed logic for proxy servers. (This is gonna break for someone... I can just feel it.) - Added SSL support in for both tcpip and http connections. - Removed support for native Unicode under perl 5.6. It was causing a big memory leak that the Unicode::String module does not incur. This means that the Unicode::String module is now a requirement for XML::Stream. - Added in support for connecting via HTTP. This takes a special server that can keep the connection alive as the HTTP connection is setup only once and is kept opne while you send and receive. This allows you to connect through proxy servers. - More tweaks for memory usage and speed ups. - Added in a new XML sotrage format to try and save space. It's a hash representation of the entire XML document. XML::Parser::Tree uses arrays of arrays and arrays of hashes which can consume memory in very short order. It was a good starting point, but it's time to move on. Se the INFO doc for more info on the new format. (Not done yet.) - Added GetXMLData, SetXMLData, BuildXML, and EscapeXML which was originally written for the Net::Jabber modules but realized that they made more sense in here. =P 1.11 ==== - Added in a module for DTD parsing. This will hopefully lead to verification of XML Streams based off of DTD. - Fixed bug in the Process function caused by the new way of handling multiple connections with detecting a broken connection. - Added code to handle listening for incoming connections on a port for a namespace. THIS IS STILL UNDER DEVELOPMENT! - Added XML::Stream::Parser to replace XML::Parser. - Fixed bug in the timeout code. 1.10 ==== - Added SetCallBacks function to repleace OnNode and provide other hooks for more functions. - Fixed initial connect function and error handling. 1.09 ==== - Updated Connect to handle changing the values of the to and from attributes directly from the function call. (Useful for proxying.) 1.08 ==== - Added boiler plate comments for the LGPL. - Added code to Send to check if the connection was lost. This fixes a Broken Pipe error that I was seeing when the program tried to write to a socket that was closed. 1.07 ==== - Added code to handle not only connecting over TCP/IP but over STDIN/STDOUT (for the new Jabber server). - Added code to handle keeping the connection alive over connections that drop the connection after a period of inactivity. 1.06 ==== - Fixed bug where Process(0) would still sleep for a short time and cause those fast loops to take longer than they should. - Added Unicode support. When you build the tree, make sure that it's latin 1 you are speaking. It's then up to the sender to ensure that the outgoing data is utf8. - Added timestamp support to debug. - STREAMERROR is now local to an object instantiaion instead of the namespace. This helps when you get an error and then grab a new object and want to connect again. 1.05 ==== - Fixed sport where Stream would die if it could not resolve your full hostname. Now it just reverts back to the result of hostname() if it can' look up the full name. - Initialized some variables to get rid of warnings with perl -w. 1.04 ==== - Changed version scheme to allow Perl to check for it. 1.0c ==== - I think I got the bug in ParseStream that removes the parse coming in while a parse is already in progress. - Fixed major bug in Process. If you got a tag in the middle of the tag it would cause an XML error. - Also, if another parse came in during another parse, the second parse tree would get built under the current parse tree and everything would grind to a halt. 1.0b ==== - Improved error handling by creating GetErrorCode and SetErrorCode. These functions allow the caller to get some information about why Process or Connect returned undef. - Added error checking if a is sent. This will call SetErrorCode and return undef. 1.0a ==== - Version bump. - Changed method of handling timeouts in the Connect and Process block. The timeout from the Connect is no longer remembered in the Process and used. This method has improved the speed of the module greatly. - Fixed bug where the Process was not properly handling a connection breakdown. It now returns undef, or "", when the server dies or the connection is dropped. 0.1b ==== - Added XML::Stream::Namespace to make writting Perl modules for other namepsaces possible. (This is highly alpha...) - Added Disconnect function to send closing tag and shut the stream down. - Added documentation list of methods in Stream.pm. 0.1a ==== - First version. - Supports connecting to a server, opening a stream, and receiving from that stream. XML-Stream-1.24/SIGNATURE000644001750001750 552012446075370 16055 0ustar00dapatrickdapatrick000000000000This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.73. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 50d9ba9467217a576024128e09372f3bee519db7 Build.PL SHA1 78a78d7e3f2c1c9c42b3e95ed605b91474341f3e CHANGES SHA1 196d154af87fc5e3d911add822f01102f2b924da INFO SHA1 e6382a2e4814837e0034b5b1fe6338d75068d7d8 LICENSE SHA1 14cbe18243296497226fedb5722a86383d6ec9ba MANIFEST SHA1 2f59d1a2a6f46c54b69ccca1059176d054474f38 META.json SHA1 d2fee66e0042926ca6eee118eb999c015565c859 META.yml SHA1 c6d88a9a28f4318a0947edf501f829e29be51c8f Makefile.PL SHA1 8e0ae69be8bd205563922ccb867cdf4dcb086d51 README SHA1 198175ef7f62b84298ea6c7cd4176aea4f8770a9 lib/XML/Stream.pm SHA1 fcb5630ffa0e0b63cc95d475f32fe356d08deefe lib/XML/Stream/IO/Select/Win32.pm SHA1 69e88671f9d5191a4eef810e868d14f9d81800eb lib/XML/Stream/Namespace.pm SHA1 694fc22f9f4a6fb1d55d2b8008b75e933278bc2f lib/XML/Stream/Node.pm SHA1 17d0f2d0c61af08a5331cdfd5bd839d58c993489 lib/XML/Stream/Parser.pm SHA1 3a369f4ec19f87441ea11ba9e617dd449a05c820 lib/XML/Stream/Parser/DTD.pm SHA1 ffe36acb769a8408c0c82b9f2f9b089ae8a50831 lib/XML/Stream/Tools.pm SHA1 f60a701eda50942a8de00e21c6ab07af1bd3ff2e lib/XML/Stream/Tree.pm SHA1 691d6c822e434d28159d175d259a8f4436bc79cf lib/XML/Stream/XPath.pm SHA1 aa8f58a1ac65c303f302ec86e3c52d48da35fcac lib/XML/Stream/XPath/Op.pm SHA1 1f4fb71bc08b45e1af29e16e5a827a728a4b532c lib/XML/Stream/XPath/Query.pm SHA1 fa6f0b83e6c3e9d9ce30c8d3d5f55c309c2ac6d7 lib/XML/Stream/XPath/Value.pm SHA1 850e2740a75782524068bf075c62dce17b6097d9 t/0-signature.t SHA1 2d39967d76139beb8af25377d4a6c51d7bcb5b76 t/buildxml.t SHA1 ed3c8cf8b15161f0584c3b37a66de39963358e35 t/cdata.t SHA1 53a1b80e7a605c905e8bccba2ce0ab65182b5648 t/load.t SHA1 94a8c53a14c1771ab1b4a5daf331a7cbaed07766 t/memory_cycle.t SHA1 5f335ada56c5454226e78d0a83b055b24f64a2c4 t/net_xmpp.t SHA1 c783fee53c26174b36405469041b59aadd816bb0 t/parse_node.t SHA1 da1f249867d9b27201b2157f0db7a3ee252ad4c4 t/parse_tree.t SHA1 1bdcc7aaf3b3377f0966976c6d52f243b5fe2fb4 t/quotes.t SHA1 416b6a366a45b581886130d4d6ecabfc953ff893 t/tcpip.t SHA1 721484da679b9a4e684001845831f617d7deed96 t/tcpip2ssl.t SHA1 191c3a9c3eeca7b58b096436ee241342e6984d2f t/test.xml SHA1 734b87f26e0f144ed9ad207649c893d153495885 t/xml2config.t SHA1 a6848d74df02bbe5be2096df4f6256c3231e47b1 t/xpath.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlSYevgACgkQjJ7fFJrTQRdJ0wCgx8i6XY4ip5b3QXaifP+sbjvQ Zy4AnivGLOdLGxWdHEck+XYA2qeQhZTD =jUG1 -----END PGP SIGNATURE----- XML-Stream-1.24/INFO000444001750001750 1706412446075370 15273 0ustar00dapatrickdapatrick000000000000XML::Stream Tree Building 101 In order to not reinvent the wheel, XML::Stream uses the XML::Parser::Tree object as the data structure it passes around and stores. Two things need to be covered in order to understand what the data looks like when you get it from XML::Stream. Section 1: What does an XML::Parser::Tree object look like? The original documentation for XML::Parser::Tree can be a little hard to understand so we will go over the structure here for completeness. The that is built is essentially a big nested array. This guarantees that you see the tags in the order receded from the stream, and that the nesting of tags is maintained. The actual structure of the tree is complicated so let's cover an example: SecondThird What we are working with is a nested tag inside the CDATA of . There are attributes on both tags that must be stored. To do this we use an array. The first element of the array is the root tag, or A. [ 'A' ] The second element is a list of all the things contained in . [ 'A', [ ] ] That new list is recursively built as you go down the hierarchy, so let's examine the structure. The first element of that new list is a hash of key/value pairs that represent the attributes of the tag you are looking at. In the case of the root tag the hash would be { 'n' => '1' }. So adding that to the list we get: [ 'A', [ { 'n' => '1' } ] ] Now, the rest of the new list is a set of two elements added at a time. Either a tag name followed by a list that represents the new tag, or a "0" (zero) followed by a string. This might be confusing so let's go to the example. As we parse the tag we see the string "First". So according to the rule we add a "0" and "First" to the list: [ 'A', [ { 'n' => '1' }, 0, "First" ] ] The next element is the tag. So the rules says that we add the tag and then a list that contains that tag: [ 'A', [ { 'n' => '1' }, 0, "First", 'B', [ ] ] ] Parsing the tag we see an attributes n = '2' and m = 'bob. So those go into a hash and that hash becomes the first element in the list for B: [ 'A', [ { 'n' => '1' }, 0, "First", 'B', [ { 'n' => '2', 'm' => 'bob' } ] ] ] Next we see that contains the CDATA "Second" so that goes into the list for B: [ 'A', [ { 'n' => '1' }, 0, "First", 'B', [ { 'n' => '2', 'm' => 'bob' } 0, "Second" ] ] ] closes and we leave this list and return to the list for . The next element there is CDATA so add a '0' and "Third" onto the list for A: [ 'A', [ { 'n' => '1' }, 0, "First", 'B', [ { 'n' => '2', 'm' => 'bob' } 0, "Second" ] 0, "Third" ] ] Now we see another tag, . So we add C and a list onto the A's list: [ 'A', [ { 'n' => '1' }, 0, "First", 'B', [ { 'n' => '2', 'm' => 'bob' } 0, "Second" ] 0, "Third", 'C', [ ] ] ] Parsing we see that it has no attributes so we add an empty hash to the list for C: [ 'A', [ { 'n' => '1' }, 0, "First", 'B', [ { 'n' => '2', 'm' => 'bob' } 0, "Second" ] 0, "Third", 'C', [ { } ] ] ] Next we see that contains no other data and ends in a />. This means that the tag is finished and contains no data. So close C and go back to . There is no other data in A so we close and we have our finished tree: [ 'A', [ { 'n' => '1' }, 0, "First", 'B', [ { 'n' => '2', 'm' => 'bob' } 0, "Second" ] 0, "Third", 'C', [ { } ] ] ] Section II: How do we build the XML::Parser::Tree? For those who are interested in how we build a tree read on, for those that got enough out of the previous section, read anyway. Recursion would be too difficult to do in this linear problem so we looked at the problem and engineered a way to use a single list to build the structure. Every time a new tag is encountered a new list is added to end of the main list. When that list closes it is removed from the main list and then added onto the end of the previous element in the list, which is usually another list. In other words: The current list looks like this: [aaa] We see a new tag and make a new list: [aaa], [bbb] Populate that list and then close it. When we close we remove from the list and make it the last element in the previous list elements list. Confused? Watch: [aaa], [bbb] --> [aaa, [bbb] ] As we "recurse" the hierarchy and close tags we push the new list back up to the previous list element and create the proper nesting. Let's go over the same example from Section I. SecondThird We start and push A on the list: [ 'A' ] Next we create a new list for the tag and populate the attribute hash: [ 'A', [ { 'n'=>'1' } ] ] Now we see the CDATA: [ 'A', [ { 'n'=>'1' }, 0, "First" ] ] Next it's the tag, so push B on the list and make a new list on the end of the main list: [ 'A', [ { 'n'=>'1' }, 0, "First", 'B' ], [ ] ] Parsing the tag we see that is has attributes and CDATA: [ 'A', [ { 'n'=>'1' }, 0, "First", 'B' ], [ {'n'=>'2','m'=>"bob"}, 0, "Second" ] ] Now closes and the magic begins... With the closing of we pop the last element off the list. Then we take that element and push it onto the last element of the main list. So we aren't pushing it onto the main list, but onto the last element of the main list: Popped value: [ {'n'=>'2','m'=>"bob"}, 0, "Second" ] List: [ 'A', [ { 'n'=>'1' }, 0, "First", 'B' ] ] Push value on last element of list: [ 'A', [ { 'n'=>'1' }, 0, "First", 'B', [ {'n'=>'2','m'=>"bob"}, 0, "Second" ] ] ] Now we see a CDATA and push that onto the last element in the list: [ 'A', [ { 'n'=>'1' }, 0, "First", 'B', [ {'n'=>'2','m'=>"bob"}, 0, "Second" ], 0, "Third" ] ] Finally we see the tag, so a 'C' is pushed onto the list, and then a new list is created to contain the new tag: [ 'A', [ { 'n'=>'1' }, 0, "First", 'B', [ {'n'=>'2','m'=>"bob"}, 0, "Second" ], 0, "Third", 'C' ], [ ] ] no attributes so an empty hash is pushed onto the list: [ 'A', [ { 'n'=>'1' }, 0, "First", 'B', [ {'n'=>'2','m'=>"bob"}, 0, "Second" ], 0, "Third", 'C' ], [ { } ] ] contains no data so nothing is to be done there. The tag closes and we do the magic again. Pop the last element off the main list and push it onto the previous element's list: [ 'A', [ { 'n'=>'1' }, 0, "First", 'B', [ {'n'=>'2','m'=>"bob"}, 0, "Second" ], 0, "Third", 'C', [ { } ] ] ] Now closes so we pop the last element off the main list and push is onto a list with the previous element, which is the string 'A': [ 'A', [ { 'n'=>'1' }, 0, "First", 'B', [ {'n'=>'2','m'=>"bob"}, 0, "Second" ], 0, "Third", 'C', [ { } ] ] ] And voila! The tree is complete. We now call the callback function, pass it the tree, and then reset the tree for the next tag to be parsed. XML-Stream-1.24/t000755001750001750 012446075370 14673 5ustar00dapatrickdapatrick000000000000XML-Stream-1.24/t/buildxml.t000444001750001750 660512446075370 17044 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests => 56; BEGIN{ use_ok( "XML::Stream","Tree", "Node" ); } my @packets; $packets[0] = ""; $packets[1] = " "; $packets[2] = " This is a test. "; $packets[3] = " foo1 foo2 "; $packets[4] = "bar"; $packets[5] = "
pA
p1p2
p7p8
p13p14
p19p20
"; $packets[6] = "valueA"; $packets[7] = "valueB"; $packets[8] = "valueC"; $packets[9] = "foo1"; $packets[10] = "foo2"; $packets[11] = "
foo3
"; $packets[12] = "foo4"; $packets[13] = "foo5"; $packets[14] = "
foo6
"; $packets[15] = " "; $packets[16] = "This is cdata with <tags/> embedded <in>it</in>."; my $packetIndex; foreach my $xmlType ("tree","node") { my $stream = XML::Stream->new(style => $xmlType); ok( defined($stream), "new() - $xmlType" ); isa_ok( $stream, "XML::Stream" ); $packetIndex = 0; $stream->SetCallBacks(node => sub{ onPacket($xmlType, @_) }); my $sid = $stream->OpenFile("t/test.xml"); while( my %status = $stream->Process()) { last if ($status{$sid} == -1); } } sub onPacket { my $xmlType = shift; my $sid = shift; if ($xmlType eq "tree") { my $tree = shift; my $test = XML::Stream::BuildXML($tree, ""); $test =~ s/\r//g; is( $test, $packets[$packetIndex], "packet[$packetIndex]" ); } if ($xmlType eq "node") { my $node = shift; my $test = XML::Stream::BuildXML($node, ""); $test =~ s/\r//g; is( $test, $packets[$packetIndex], "packet[$packetIndex]" ); $node->add_raw_xml(""); $test = XML::Stream::BuildXML($node); $test =~ s/\r//g; is( $test, $packets[$packetIndex], "packet[$packetIndex]" ); } $packetIndex++; } XML-Stream-1.24/t/quotes.t000444001750001750 214412446075370 16536 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests => 3; # Test for RT#17325 BEGIN { use_ok('XML::Stream', 'Parser'); } my @test_strings = ( { xml => q[awayAway], message => 'one double quote', }, { xml => q[awayAway], message => 'one single quote', } ); foreach my $test_string ( @test_strings ) { my $p = XML::Stream::Parser->new(); my $return; my $message = $test_string->{'message'}; # The nature of the bug which this test aims to prove is such that an # infinite loop is caused on failure, hence this timeout code eval { local $SIG{ALRM} = sub { die "TIMED OUT\n" }; alarm 3; $return = $p->parse( $test_string->{'xml'} ); } or do { $return = ''; $message .= ' - ' . $@; }; isa_ok ( $return, 'ARRAY', $message ); } XML-Stream-1.24/t/net_xmpp.t000444001750001750 171012446075370 17046 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More; use XML::Stream 'Node'; # this won't work if 'Node' is not listed there but in Net::XMPP it is working # apparently by chance as one of the sub-modules import XML::Stream with Node option # cases that are used in Net::XMPP # when connecting to GTalk plan tests => 3; my $xs = XML::Stream->new( 'style' => 'node', 'debugfh' => undef, 'debuglevel' => '-1', 'debugtime' => 0, ); isa_ok $xs, 'XML::Stream'; $xs->Connect( 'hostname' => 'talk.google.com', 'port' => 5222, 'namespace' => 'jabber:client', 'connectiontype' => 'tcpip', 'timeout' => 10, 'ssl_verify' => 0, 'ssl' => 0, '_tls' => 1, 'to' => 'gmail.com', ); isa_ok $xs, 'XML::Stream'; eval "use Test::Memory::Cycle"; my $fail = $@; # TODO... SKIP: { skip 'Needs Test::Memory::Cycle', 1 if $fail; memory_cycle_ok($xs); } XML-Stream-1.24/t/tcpip.t000444001750001750 137112446075370 16336 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests => 4; BEGIN{ use_ok("XML::Stream","Node"); } my $stream = XML::Stream->new(style=>"node"); ok( defined($stream), "new()" ); isa_ok( $stream, "XML::Stream" ); SKIP: { skip "No network communication allowed", 1 if ($ENV{NO_NETWORK}); my $sock = IO::Socket::INET->new(PeerAddr=>'jabber.org:5222'); skip "Cannot open connection (maybe a firewall?)",1 unless defined($sock); my $status = $stream->Connect(hostname=>"jabber.org", port=>5222, namespace=>"jabber:client", connectiontype=>"tcpip", timeout=>10); ok( defined($status), "Made connection"); } XML-Stream-1.24/t/test.xml000444001750001750 352312446075370 16534 0ustar00dapatrickdapatrick000000000000 This is a test. foo1 foo2 bar
pA
p1p2
p7p8
p13p14
p19p20
valueA valueB valueC foo1 foo2
foo3
foo4 foo5
foo6
embedded it.]]>
XML-Stream-1.24/t/parse_node.t000444001750001750 230212446075370 17331 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests => 6; use XML::Stream qw( Node ); my @tests; $tests[4] = 1; my $stream = XML::Stream->new( #debug=>"stdout",debuglevel=>99, style=>"node"); $stream->SetCallBacks(node=>sub{ &onPacket(@_) }); my $sid = $stream->OpenFile("t/test.xml"); while( my %status = $stream->Process()) { last if ($status{$sid} == -1); } foreach (2..6) { ok $tests[$_]; } sub onPacket { my $sid = shift; my ($packet) = @_; return unless $packet->get_attrib("test"); if ($packet->get_attrib("test") eq "2") { $tests[2] = 1; } if ($packet->get_attrib("test") eq "3") { if (($packet->children())[1]->get_tag() eq "bar") { $tests[3] = 1; } } if ($packet->get_attrib("test") eq "4") { $tests[4] = 0; } if ($packet->get_attrib("test") eq "5") { if (((($packet->children())[1]->children())[1]->children())[1]->get_cdata() eq "This is a test.") { $tests[5] = 1; } } if ($packet->get_attrib("test") eq "6") { if ($packet->get_cdata() eq "This is cdata with embedded it.") { $tests[6] = 1; } } } my $node = XML::Stream::Node->new("test",""); is ($node->GetXML(), "<foo/>"); XML-Stream-1.24/t/memory_cycle.t000444001750001750 40412446075370 17662 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More; my $fail; BEGIN { eval "use Test::Memory::Cycle"; $fail = $@; } plan skip_all => 'Need Test::Memory::Cycle' if $fail; plan tests => 1; use XML::Stream; my $stream = XML::Stream->new; memory_cycle_ok($stream); XML-Stream-1.24/t/0-signature.t000444001750001750 172312446075370 17356 0ustar00dapatrickdapatrick000000000000#!/usr/bin/perl use strict; use warnings; use Test::More; if (!$ENV{TEST_SIGNATURE}) { plan skip_all => "Set the environment variable TEST_SIGNATURE to enable this test."; } elsif (!eval { require Module::Signature; 1 }) { plan skip_all => "Next time around, consider installing Module::Signature, ". "so you can verify the integrity of this distribution."; } elsif ( !-e 'SIGNATURE' ) { plan skip_all => "SIGNATURE not found"; } elsif ( -s 'SIGNATURE' == 0 ) { plan skip_all => "SIGNATURE file empty"; } elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) { plan skip_all => "Cannot connect to the keyserver to check module ". "signature"; } else { plan tests => 1; } my $ret = Module::Signature::verify(); SKIP: { skip "Module::Signature cannot verify", 1 if $ret eq Module::Signature::CANNOT_VERIFY(); cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), "Valid signature"; } XML-Stream-1.24/t/parse_tree.t000444001750001750 166512446075370 17356 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests => 4; use XML::Stream qw( Tree ); my @tests; $tests[4] = 1; my $stream = XML::Stream->new(style => "tree"); $stream->SetCallBacks(node => sub{ onPacket(@_) }); my $sid = $stream->OpenFile("t/test.xml"); my %status; while( %status = $stream->Process()) { last if ($status{$sid} == -1); } foreach (2..5) { ok $tests[$_]; } sub onPacket { my $sid = shift; my $packet = shift; return unless exists($packet->[1]->[0]->{test}); if ($packet->[1]->[0]->{test} eq "2") { $tests[2] = 1; } if ($packet->[1]->[0]->{test} eq "3") { if (defined($packet->[1]->[3]) && ($packet->[1]->[3] eq "bar")) { $tests[3] = 1; } } if ($packet->[1]->[0]->{test} eq "4") { $tests[4] = 0; } if ($packet->[1]->[0]->{test} eq "5") { if (defined($packet->[1]->[4]->[4]->[4]->[2]) && ($packet->[1]->[4]->[4]->[4]->[2] eq "This is a test.")) { $tests[5] = 1; } } } XML-Stream-1.24/t/tcpip2ssl.t000444001750001750 167412446075370 17150 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests=>3; SKIP: { eval("use IO::Socket::SSL 0.81;"); skip "IO::Socket::SSL not installed", 2 if $@; skip "No network communication allowed", 2 if ($ENV{NO_NETWORK}); BEGIN{ use_ok( "XML::Stream","Tree", "Node" ); } my $stream = XML::Stream->new( style=>'node', debug=>'stdout', debuglevel=>0, ); ok( defined($stream), "new()" ); SKIP: { my $status = $stream->Connect(hostname=>"jabber.org", port=>5223, namespace=>"jabber:client", connectiontype=>"tcpip", ssl=>1, ssl_verify=>0x00, timeout=>10); skip "Cannot create initial socket", 1 unless $stream; ok( $stream, "converted" ); } } XML-Stream-1.24/t/cdata.t000444001750001750 145712446075370 16300 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests => 11; BEGIN { use_ok('XML::Stream', 'Node'); } my $x = XML::Stream::Node->new; isa_ok $x, 'XML::Stream::Node'; $x->set_tag("body"); $x->add_cdata("one"); is ($x->GetXML(), q[one], 'cdata'); my $y = $x->copy; isa_ok $y, 'XML::Stream::Node'; isnt $x, $y, 'not the same'; is ($y->GetXML(), q[one], 'copy cdata'); $x->add_child("a","two")->put_attrib(href=>"http://www.google.com"); $x->add_cdata("three"); is ($x->GetXML(), q[onetwothree], 'cdata/element/cdata'); my $z = $x->copy; isa_ok $z, 'XML::Stream::Node'; isnt $x, $z, 'not the same'; isnt $y, $z, 'not the same'; is ($z->GetXML(), q[onetwothree], 'copy cdata/element/cdata'); XML-Stream-1.24/t/load.t000444001750001750 11412446075370 16110 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests=>1; use_ok('XML::Stream'); XML-Stream-1.24/t/xml2config.t000444001750001750 255712446075370 17276 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests=>9; use_ok 'XML::Stream', qw( Tree Node ); my @tests; $tests[4] = 1; $tests[8] = 1; my $parser_tree = XML::Stream::Parser->new(style=>"tree"); my $tree = $parser_tree->parsefile("t/test.xml"); my %config = %{&XML::Stream::XML2Config($tree)}; if (exists($config{blah})) { my @keys = keys(%{$config{blah}}); if ($#keys == -1) { $tests[2] = 1; } } if (exists($config{foo}->{bar})) { my @keys = keys(%{$config{foo}->{bar}}); if ($#keys == -1) { $tests[3] = 1; } } if (exists($config{comment_test})) { $tests[4] = 0; } if (exists($config{last}->{test1}->{test2}->{test3})) { if ($config{last}->{test1}->{test2}->{test3} eq "This is a test.") { $tests[5] = 1; } } my $parser_node = XML::Stream::Parser->new(style=>"node"); my $node = $parser_node->parsefile("t/test.xml"); %config = %{&XML::Stream::XML2Config($node)}; if (exists($config{blah})) { my @keys = keys(%{$config{blah}}); if ($#keys == -1) { $tests[6] = 1; } } if (exists($config{foo}->{bar})) { my @keys = keys(%{$config{foo}->{bar}}); if ($#keys == -1) { $tests[7] = 1; } } if (exists($config{comment_test})) { $tests[8] = 0; } if (exists($config{last}->{test1}->{test2}->{test3})) { if ($config{last}->{test1}->{test2}->{test3} eq "This is a test.") { $tests[9] = 1; } } foreach (2..9) { ok $tests[$_]; } XML-Stream-1.24/t/xpath.t000444001750001750 1163112446075370 16363 0ustar00dapatrickdapatrick000000000000use strict; use warnings; use Test::More tests=>105; BEGIN{ use_ok("XML::Stream","Node","Tree"); } my @value; foreach my $type ("tree","node") { my $parser = XML::Stream::Parser->new(style=>$type); isa_ok($parser,"XML::Stream::Parser"); my $node = $parser->parsefile("t/test.xml"); isa_ok($node,"ARRAY") if ($type eq "tree"); isa_ok($node,"XML::Stream::Node") if ($type eq "node"); @value = &XML::Stream::XPath($node,'last/@test'); is( $#value, 0, "'last/\@test' - Only one match?"); is( $value[0], 5, "correct value?"); @value = &XML::Stream::XPath($node,'last/test1/test2/test3/text()'); is( $#value, 0, "'last/test1/test2/test3/text()' - Only one match?"); is( $value[0], "This is a test.", "correct value?"); @value = &XML::Stream::XPath($node,'last/test1/test2/test3'); is( $#value, 0, "'last/test1/test2/test3' - Only one match?"); is( &XML::Stream::GetXMLData("value",$value[0]), "This is a test.", "correct value?"); my %value = &XML::Stream::XPath($node,'foo/@*'); is( scalar(keys(%value)), 1, "'foo/\@\*' - Only one attribute?"); is( $value{test}, 3, "correct value?"); @value = &XML::Stream::XPath($node,'last//test3'); is( $#value, 0, "'last//test3' - Only one match?"); is( &XML::Stream::GetXMLData("value",$value[0]), "This is a test.", "correct value?"); @value = &XML::Stream::XPath($node,'a//e'); is( $#value, 2, "'a//e' - Only three matches?"); is( &XML::Stream::GetXMLData("tag",$value[0]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[0],"e"), "foo1", "correct value?"); is( &XML::Stream::GetXMLData("tag",$value[1]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[1]), "foo1", "correct value?"); is( &XML::Stream::GetXMLData("tag",$value[2]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[2]), "foo2", "correct value?"); @value = &XML::Stream::XPath($node,'//e'); is( $#value, 3, "'//e' - Only four matches?"); is( &XML::Stream::GetXMLData("tag",$value[0]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[0],"e"), "foo1", "correct value?"); is( &XML::Stream::GetXMLData("tag",$value[1]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[1]), "foo1", "correct value?"); is( &XML::Stream::GetXMLData("tag",$value[2]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[2]), "foo2", "correct value?"); is( &XML::Stream::GetXMLData("tag",$value[3]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[3]), "bar", "correct value?"); @value = &XML::Stream::XPath($node,'a/b//d/e'); is( $#value, 1, "'a/b//d/e' - Only two matches?"); is( &XML::Stream::GetXMLData("tag",$value[0]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[0],"e"), "foo1", "correct value?"); is( &XML::Stream::GetXMLData("tag",$value[1]), "e", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[1]), "foo2", "correct value?"); @value = &XML::Stream::XPath($node,'library//chapter//para/@test'); is( $#value, 1, "'library//chapter//para/\@test' - Only two matches?"); is( $value[0], "b", "correct value?"); is( $value[1], "a", "correct value?"); @value = &XML::Stream::XPath($node,'filter[@id and @mytest="2"]/text()'); is( $#value, 0, "'filter[\@id and \@mytest=\"2\"]/text()' - Only one match?"); is( $value[0], "valueA", "correct value?"); @value = &XML::Stream::XPath($node,'newfilter[@bar and sub="foo1"]'); is( $#value, 0, "'newfilter[\@bar and sub=\"foo1\"]' - Only one match?"); is( &XML::Stream::GetXMLData("tag",$value[0]), "newfilter", "is it ?"); is( &XML::Stream::GetXMLData("value",$value[0],"sub"), "foo1", "correct value?"); @value = &XML::Stream::XPath($node,'startest/*[@test]'); is( $#value, 1, "'startest/*[\@test]' - Only two matches?"); is( &XML::Stream::GetXMLData("tag",$value[0]), "foo", "is the first one ?"); is( &XML::Stream::GetXMLData("tag",$value[1]), "bing", "is the second one ?"); @value = &XML::Stream::XPath($node,'startest/*[not(@test)]'); is( $#value, 0, "'startest/*[not(\@test)]' - Only one matches?"); is( &XML::Stream::GetXMLData("tag",$value[0]), "bar", "is it ?"); @value = &XML::Stream::XPath($node,'startest/*[name() != "foo"]'); is( $#value, 1, "'startest/*[name() != \"foo\"]' - Only two matches?"); is( &XML::Stream::GetXMLData("tag",$value[0]), "bar", "is it ?"); is( &XML::Stream::GetXMLData("tag",$value[1]), "bing", "is it ?"); @value = &XML::Stream::XPath($node,'//e[starts-with(text(),"foo")]'); is( $#value, 1, "'//e[starts-with(text(),\"foo\")]' - Only two matches?"); is( &XML::Stream::GetXMLData("value",$value[0]), "foo1", "correct value?"); is( &XML::Stream::GetXMLData("value",$value[1]), "foo2", "correct value?"); } XML-Stream-1.24/lib000755001750001750 012446075370 15176 5ustar00dapatrickdapatrick000000000000XML-Stream-1.24/lib/XML000755001750001750 012446075370 15636 5ustar00dapatrickdapatrick000000000000XML-Stream-1.24/lib/XML/Stream.pm000444001750001750 33073412446075370 17636 0ustar00dapatrickdapatrick000000000000############################################################################## # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # Jabber # Copyright (C) 1998-2004 Jabber Software Foundation http://jabber.org/ # ############################################################################## package XML::Stream; =head1 NAME XML::Stream - Creates an XML Stream connection and parses return data =head1 SYNOPSIS XML::Stream is an attempt at solidifying the use of XML via streaming. =head1 DESCRIPTION This module provides the user with methods to connect to a remote server, send a stream of XML to the server, and receive/parse an XML stream from the server. It is primarily based work for the Etherx XML router developed by the Jabber Development Team. For more information about this project visit http://xmpp.org/protocols/streams/. XML::Stream gives the user the ability to define a central callback that will be used to handle the tags received from the server. These tags are passed in the format defined at instantiation time. the closing tag of an object is seen, the tree is finished and passed to the call back function. What the user does with it from there is up to them. For a detailed description of how this module works, and about the data structure that it returns, please view the source of Stream.pm and look at the detailed description at the end of the file. NOTE: The parser that XML::Stream::Parser provides, as are most Perl parsers, is synchronous. If you are in the middle of parsing a packet and call a user defined callback, the Parser is blocked until your callback finishes. This means you cannot be operating on a packet, send out another packet and wait for a response to that packet. It will never get to you. Threading might solve this, but as we all know threading in Perl is not quite up to par yet. This issue will be revisted in the future. =head1 METHODS =cut use 5.008; use strict; use warnings; use Sys::Hostname; use IO::Socket; use IO::Select; use FileHandle; use Carp; use POSIX; use Authen::SASL; use MIME::Base64; use utf8; use Encode; use Scalar::Util qw(weaken); use XML::Stream::IO::Select::Win32; use XML::Stream::Tools; $SIG{PIPE} = "IGNORE"; use vars qw($VERSION $PAC $SSL $NONBLOCKING %HANDLERS $NETDNS %XMLNS ); ############################################################################## # Define the namespaces in an easy/constant manner. #----------------------------------------------------------------------------- # 0.9 #----------------------------------------------------------------------------- $XMLNS{'stream'} = "http://etherx.jabber.org/streams"; #----------------------------------------------------------------------------- # 1.0 #----------------------------------------------------------------------------- $XMLNS{'xmppstreams'} = "urn:ietf:params:xml:ns:xmpp-streams"; $XMLNS{'xmpp-bind'} = "urn:ietf:params:xml:ns:xmpp-bind"; $XMLNS{'xmpp-sasl'} = "urn:ietf:params:xml:ns:xmpp-sasl"; $XMLNS{'xmpp-session'} = "urn:ietf:params:xml:ns:xmpp-session"; $XMLNS{'xmpp-tls'} = "urn:ietf:params:xml:ns:xmpp-tls"; ############################################################################## if (eval "require Net::DNS;" ) { require Net::DNS; import Net::DNS; $NETDNS = 1; } else { $NETDNS = 0; } $VERSION = "1.24"; $NONBLOCKING = 0; #use XML::Stream::Namespace; use XML::Stream::Parser; use XML::Stream::XPath; ############################################################################## # # Setup the exportable objects # ############################################################################## my @EXPORT_OK = qw(Tree Node); sub import { my $class = shift; foreach my $module (@_) { eval "use XML::Stream::$module;"; die($@) if ($@); my $lc = lc($module); eval("\$HANDLERS{\$lc}->{startElement} = \\&XML::Stream::${module}::_handle_element;"); eval("\$HANDLERS{\$lc}->{endElement} = \\&XML::Stream::${module}::_handle_close;"); eval("\$HANDLERS{\$lc}->{characters} = \\&XML::Stream::${module}::_handle_cdata;"); } } =pod =head2 new new( debug => string, debugfh => FileHandle, debuglevel => 0|1|N, debugtime => 0|1, style => string) Creates the XML::Stream object. B should be set to the path for the debug log to be written. If set to "stdout" then the debug will go there. Also, you can specify a filehandle that already exists by using B. B determines the amount of debug to generate. 0 is the least, 1 is a little more, N is the limit you want. B determines wether a timestamp should be preappended to the entry. B