GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST::XML (3)

.ds Aq ’

NAME

Test::XML - Compare XML in perl tests

CONTENTS

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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::XML (3) 2009-07-02

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.