| 1 | use strict; | ||
| 2 | use XML::Rules; | ||
| 3 | use Data::Dumper; | ||
| 4 | |||
| 5 | if (!@ARGV) { | ||
| 6 | die "Usage: xml2XMLRules examplefile.xml [otherexample.xml ...] | ||
| 7 | Generates a set of XML::Rules rules based on one or more example XMLs. | ||
| 8 | It's better to provide several examples if you have them in case there | ||
| 9 | are any optional attributes or tags that are sometimes, but not always | ||
| 10 | repeated.\n" | ||
| 11 | } | ||
| 12 | |||
| 13 | local $Data::Dumper::Terse = 1; | ||
| 14 | local $Data::Dumper::Indent = 1; | ||
| 15 | print Dumper(XML::Rules::inferRulesFromExample( @ARGV)); |