views:

107

answers:

2

Is there any little (1-2 .pm's) parser based around XML::* and suitable for replacing CGI.pm's constructions like:

foreach($xmlnodes) {
    print table( TR( td( $_) ) ); }

with node2html($node,$rules)?

I ain't going to fire up XSLT.

+5  A: 

Whenever you want to find modules, search CPAN. Have a look around, and see what you like. The more you do it, the better sense of the landscape you'll have. Soon, you won't even have to ask. :)

I'm not sure what you are asking about, though, because you say "parser" but it seems that you want to go the other way. If you want to rewrite XML, I might recommend XML::Twig.

brian d foy
"Soon, you won't even have to ask. :)" - wishful thinking I fear.
Kinopiko
+1  A: 

Is it push style templating you're thinking of? ie. take a plain HTML file as the template and using CSS or XSLT selectors to push content into it?

If so then two CPAN modules I've used to do this are:

Also see the Perlmonks post called Push style templating systems which provides more information including a list of push style templates available.

If not push style then are you looking for HTML builders? If so see this Stackoverflow question: CL-WHO-like HTML templating for other languages?

/I3az/

draegtun