Search code examples
xmlperltemplates

Is there a small Perl XML parser that can replace CGI.pm's HTML generation functions?


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.


Solution

  • 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/