| Module Info
| Add a review of XML-Rules
A very nice attempt to parse XML. For me, this module perfectly fills the gap between XML::Simple which I use for very minimal XML documents and XML::Schema for read/write access to complex stuff.
XML::Rules comes with a lot of built-in rules and a great "inferRulesFromExample" method that creates appopriate rules for you out-of-the-box. For me, this is a big time saver as I don't have to write XML schemas for medium-complex XML documents and still can tell the parser which tags shall be arrays (XML::Simple on steroids as the docs say).
I didn't experiment with writing XML docs nor did I test any kind of validation but I guess I'll stick to schema-based processing for that kind of work.
There should be some "Quick-Start" Tutorial that points to something like this:
my $rules = XML::Rules::inferRulesFromExample( <xml_example> );
print Data::Dump::dump( $rules );
# now refine the rules skeleton
my $parser = XML::Rules->new( rules => $rules );
my $data = $parser->parse( <xml> );
The procedure above saves me a lot of repetive tasks defining all possible tags and attributes by hand since most of XML tags are of type "no content", "content" or "as array no content".