I don't think you will find something like this on CPAN, it is not a simple problem, especially if the DTDs are complex and if you want the documents to be really random.
I built a generator of XML documents once (actually it was SGML, it was in 1992, and it was in C, not in Perl), the general algorythm was that each element in the DTD was generated by a function, that would randomly choose between alternate possibilities when needed, and in turn call the function for other elements. The DTD was quite complex, with nested sections of arbitrary level and complex relationship between elements in various sections. It was great fun, even though it was in C at the time.
| [reply] |
Yep, I quickly dropped the idea of using the DTD as templates. I am going to use a template XML, and generate more tags based on that, so if it says: <value repeat=5> I know I'll repeat the <value> tag 5 times...
| [reply] [d/l] [select] |
Try XML::AutoWriter. The random bit you'll have to do for yourself, but AutoWriter will stick to the DTD for you. | [reply] |