#!/usr/bin/perl

use strict;
use warnings;

use XML::LibXSLT;
use XML::LibXML;

my $xslt = XML::LibXSLT->new();
$xslt->max_depth(1000000);
my $source_small = XML::LibXML->load_xml(location => 'maxvars_small.xml');
my $source_big = XML::LibXML->load_xml(location => 'maxvars_big.xml');
my $style_doc = XML::LibXML->load_xml(location=>'maxvars.xslt.xml', no_cdata=>1);
my $stylesheet = $xslt->parse_stylesheet($style_doc);

## works
my $results_small = $stylesheet->transform($source_small);
print $stylesheet->output_as_bytes($results_small),"\n";

## fails
my $results_big = $stylesheet->transform($source_big);
print $stylesheet->output_as_bytes($results_big),"\n";

         
