3 # You are going to make our Person and Employee classes capable of
4 # outputting an XML document describing the object.
6 # The document will contain a tag and value for each attribute.
8 # You will use method modifiers and roles to achieve this.
10 # Start by creating a new role, OutputsXML.
12 # This role should require an "as_xml" method in the classes which
15 # This role should also use an around modifier on the as_xml method in
16 # order to make sure the document is well-formed XML.
18 # This document will look something like this:
20 # <?xml version="1.0" encoding="UTF-8"?>
22 # <first_name>Joe</first_name>
23 # <last_name>Smith</last_name>
26 # Use the role to create the xml declaration (the first line) and the
27 # container tags (<person> or <employee)
29 # The classes should return a list strings. Each string should be a
30 # tagged value for an attribute. For consistency, return the
31 # attributes in sorted order.
33 # ( '<first_name>Joe</first_name>', '<last_name>Smith</last_name>' )
35 # If an attribute is empty, just output an empty tag (<foo></foo>).
37 # Use an augment modifier in the Person and Employee classes to allow
38 # Employee to return just its own attributes.
45 use MooseClass::Tests;
50 MooseClass::Tests::tests04();