Every object of the XML:: Simple class exposes two methods, XMLin() and XMLout().
The XMLin() method reads an XML file or string and converts it to a Perl representation; the XMLout() method does the reverse, reading a Perl structure and returning it as an XML document instance.
That's where the very useful Perl module called XML:: Simple comes in.
I just want to run a DTD and an XML file through a magic black box, and get a yes or no on if the XML file is valid (and possibly find out what the problem is, so I can notify the user).
It is aimed at developers who have a need to control the types and content of the data in their XML documents, and assumes that you are familiar with the basic concepts of XML.
(You can get a basic grounding in XML itself through the This tutorial demonstrates validation using Java from the command line, but the principles and concepts of validation are the same for any programming environment, so Java experience is not required to gain a thorough understanding.
The ease of use in XML:: Simple's basic XML handling extends to XML documents with multiple levels as well. If you read this in with XMLin(), you'll receive a structure like the one shown in Listing B.
XML:: Simple represents repeated elements as items in an anonymous array.