Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Perl resources for generating XML fragments from a DTD?

by loris (Hermit)
on Dec 21, 2004 at 12:43 UTC ( #416443=perlquestion: print w/replies, xml ) Need Help??

loris has asked for the wisdom of the Perl Monks concerning the following question:

Dear Enlightened,

Are there any Perl resources for generating XML fragments from a DTD? I would like to use a DTD to create XML templates, which I can then modify.

Thanks for your help,

loris

  • Comment on Perl resources for generating XML fragments from a DTD?

Replies are listed 'Best First'.
Re: Perl resources for generating XML fragments from a DTD?
by Aristotle (Chancellor) on Dec 21, 2004 at 13:02 UTC

    It shouldn't be hard to do that using XML::ParseDTD — that is, in those cases where it's feasible. After all, if element A may contain element B, and element B may contain element A, there's no way for the generator to know when to stop nesting. I suppose you could just create minimal templates with only the minimum required tags the DTD demands — for the cases I can think of right now, that is always a finite set if not one with only a single member.

    Makeshifts last the longest.

Re: Perl resources for generating XML fragments from a DTD?
by gmpassos (Priest) on Dec 22, 2004 at 02:07 UTC
    You can take a look at XML::Smart::DTD take comes with XML::Smart. It has a set of methods to get informations from the DTD parsed by it.

    You also can take a look in the methods apply_dtd() of XML::Smart, since it will automatically create XML files with the default values and format of the DTD.

    Graciliano M. P.
    "Creativity is the expression of liberty".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://416443]
Approved by zejames
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2020-12-04 02:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (58 votes). Check out past polls.

    Notices?