in reply to Automatically generating XML

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.

Replies are listed 'Best First'.
Re: Re: Automatically generating XML
by asiufy (Monk) on Feb 01, 2002 at 18:27 UTC
    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...