Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

test::xml(3pm) [debian man page]

Test::XML(3pm)						User Contributed Perl Documentation					    Test::XML(3pm)

NAME
Test::XML - Compare XML in perl tests SYNOPSIS
use Test::XML tests => 3; is_xml( '<foo />', '<foo></foo>' ); # PASS is_xml( '<foo />', '<bar />' ); # FAIL isnt_xml( '<foo />', '<bar />' ); # PASS is_well_formed_xml('<foo/>'); # PASS is_well_formed_xml('<foo>'); # FAIL DESCRIPTION
This module contains generic XML testing tools. See below for a list of other modules with functions relating to specific XML modules. FUNCTIONS
is_xml ( GOT, EXPECTED [, TESTNAME ] ) This function compares GOT and EXPECTED, both of which are strings of XML. The comparison works semantically and will ignore differences in syntax which are meaningless in xml, such as different quote characters for attributes, order of attributes or empty tag styles. Returns true or false, depending upon test success. isnt_xml( GOT, MUST_NOT_BE [, TESTNAME ] ) This function is similiar to is_xml(), except that it will fail if GOT and MUST_NOT_BE are identical. is_well_formed_xml( XML [, TESTNAME ] ) This function determines whether or not a given XML string is parseable as XML. is_good_xml ( XML [, TESTNAME ] ) This is an alias for is_well_formed_xml(). NOTES
There are several features of XML::SemanticDiff that may suprise you if you are not aware of them. In particular: o Leading and trailing whitespace is always stripped, even in elements with character content. o Whitespace inside character content is always stripped down to a single space. o In mixed content elements (ie: an element with both text and elements beneath it), all text is treated as a single value. o The order of elements is ignored. SEE ALSO
Test::XML::SAX, Test::XML::Twig. Test::More, XML::SemanticDiff. AUTHOR
Dominic Mitchell, <cpan2 (at) semantico.com> COPYRIGHT AND LICENSE
Copyright 2002 by semantico This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2009-07-02 Test::XML(3pm)

Check Out this Related Man Page

XML::RSS::LibXML::MagicElement(3pm)			User Contributed Perl Documentation		       XML::RSS::LibXML::MagicElement(3pm)

NAME
XML::RSS::LibXML::MagicElement - Represent A Non-Trivial RSS Element SYNOPSIS
us XML::RS::LibXML::MagicElement; my $xml = XML::RSS::LibXML::MagicElement->new( content => $textContent, attributes => @attributes ); DESCRIPTION
This module is a handy object that allows users to access non-trivial RSS elements in XML::RSS style. For example, suppose you have an RSS feed with an element like the following: <channel> <title>Example</title> <tag attr1="foo" attr2="bar">baz</tag> ... </channel> While it is simple to access the title element like this: $rss->{channel}->{title}; It was slightly non-trivial for the second tag. With this module, <tag> is parsed as a XML::RSS::LibXML::MagicElement object and then you can access all the elements like so: $rss->{channel}->{tag}; # "baz" $rss->{channel}->{tag}->{attr1}; # "foo" $rss->{channel}->{tag}->{attr2}; # "bar" METHODS
new Create a new MagicElement object. attributes Returns the list of attributes associated with this element toString Returns the string representation of this object. By default we use the "text content" of the found tag, but for XML::RSS compatibility, we use the concatenation of the attributes if no content is found. AUTHOR
Copyright 2005 Daisuke Maki <dmaki@cpan.org>. All rights reserved. Development partially funded by Brazil, Ltd. <http://b.razil.jp> perl v5.12.4 2011-09-17 XML::RSS::LibXML::MagicElement(3pm)
Man Page