#!/usr/bin/perl -w use XML::LibXSLT; use XML::LibXML; my $s = " file_test1 subject1 Color Blue Texture Coarse file_test2 subject2 Color Blue "; print "Content-type: text/html\n\n"; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $source = $parser->parse_string($s); my $style_doc = $parser->parse_file('style.xsl'); my $stylesheet = $xslt->parse_stylesheet($style_doc); my $results = $stylesheet->transform($source); print $stylesheet->output_string($results);