[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] The best option?


Subject: Re: [xsl] The best option?
From: Cas Tuyn <Cas.Tuyn@xxxxxxxx>
Date: Tue, 23 Sep 2003 15:46:41 +0200

Frank,

We use Perl with the Sablotron engine to transform XML into HTML, this is fast 
and works in batch mode too. The design of the XSLT we do in xmlspy. 

I'm now busy generating an all-XML process, to get interactivity in the 
end-result.

Cas

For all Perl fans:

use XML::Sablotron;
use XML::LibXML;

   my $sab = new XML::Sablotron();
   $sab->RegHandler(0, { MHMakeCode => \&myMHMakeCode,
                         MHLog => \&myMHLog,
                         MHError => \&myMHError });
   my $sit = new XML::Sablotron::Situation;

   open (LOGHANDLE, ">>$sablolog") or die "Can't write to $sablolog: $!";

   foreach my $procedure (@filestodo) {
      my $output = "$coachloc/${procedure}.html";

      open OUT, ">$output" or die "Couldn't write to $output: $!";

      $sab->process($sit, "$template", "${procedure}.xml", 'arg:/result');
      my $result = $sab->getResultArg('arg:/result');

      print OUT "$result\n";

      close(OUT) or die "Couldn't close $output: $!";

   }

   close(LOGHANDLE);

sub myMHMakeCode {
    my ($self, $processor, $severity, $facility, $code) = @_;
    return $code; # I can deal with internal numbers
}

sub myMHLog {
    my ($self, $processor, $code, $level, @fields) = @_;
    return unless $level > 1;   # only warn and up
    print LOGHANDLE "[Sablot: $code]\n" . (join "\n", @fields, "");
}

sub myMHError {
    myMHLog(@_);
    die "Dying from Sablotron errors, see log\n";


On Tuesday 23 September 2003 14:17, Frank wrote:
> Thanks, then the best solution to forget problems at the users' browser is
> to transform XML in my machine(implement a server side solution) , but have
> you got any example of this or any link to view this??



-- 
The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords