1

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.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
kagali-san
  • 2,964
  • 7
  • 48
  • 87

2 Answers2

5

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
  • 129,424
  • 31
  • 207
  • 592
  • 3
    "Soon, you won't even have to ask. :)" - wishful thinking I fear. –  Sep 07 '10 at 07:13
2

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/

Community
  • 1
  • 1
draegtun
  • 22,441
  • 5
  • 48
  • 71