Test::XML::Ordered - compare two XML files for equivalency, in an ordered fashion.
use Test::More tests => 1; use Test::XML::Ordered; # TEST:$c++; is_xml_ordered( [ string => $got_xml_source, ], # Got. [ string => $expected_xml_source, ], # Expected. {}, # Options "Equivalent", # Blurb );
This module is a test module which compares two XML files for equivalence in an ordered fashion. It was written after I (= Shlomi Fish) realised that XML::SemanticDiff, which is the basis for Test::XML, and which I maintain, compares two XML files for equivalence in a "semantic" fashion where elements can be present in several possible orders. (It does not always do the right thing with this respect, but even if it did, it is not normally what I want.).
Other advantages of Test::XML::Ordered are:
Based on XML::LibXML instead of XML::Parser.
Handles namespaces properly.
Compares two XMLs for equivalance. $got_params and $expected_params are array references passed to XML::LibXML::Reader . $args is an hash reference of options (currently not used but will be used in the future). $message is the blurb.
For internal use for now.
Shlomi Fish, http://www.shlomifish.org/ .
Please report any bugs or feature requests to the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-XML-Ordered. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Test::XML::Ordered
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-XML-Ordered
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Test-XML-Ordered
CPAN Ratings
http://cpanratings.perl.org/d/Test-XML-Ordered
MetaCPAN
http://metacpan.org/release/Test-XML-Ordered
Copyright 2012 Shlomi Fish.
This program is distributed under the MIT (X11) License: http://www.opensource.org/licenses/mit-license.php
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
To install Test::XML::Ordered, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::XML::Ordered
CPAN shell
perl -MCPAN -e shell install Test::XML::Ordered
For more information on module installation, please visit the detailed CPAN module installation guide.