Skip Menu |

This queue is for tickets about the XML-LibXSLT CPAN distribution.

Report information
The Basics
Id: 143
Status: resolved
Priority: 0/
Queue: XML-LibXSLT

People
Owner: Nobody in particular
Requestors: dcameron [...] bcs.org.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.31
Fixed in: 0.94



Subject: LibXSLT SEGVs on invalid xsl:stylesheet element
Distribution XML-LibXSLT-1.31 (from Randy Kobes repository) Perl Binary build 628 provided by ActiveState Tool Corp. http://www.ActiveState.com Built 15:41:05 Jul 4 2001 Any error in the <xsl:stylesheet> element within a stylesheet causes LibXSLT to SEGV. This error came up on the Perl-XML list in mid-December raised by Roger Perttu, but I thought that I'd log it here anyway. Here's an example, I set the version to 2.0, it should be 1.0: use strict; use warnings; use XML::LibXML; use XML::LibXSLT; my $doc = XML::LibXML->new->parse_string(<<EOT); <?xml version="1.0"?> <dromedaries> </dromedaries> EOT my $templateDoc = XML::LibXML->new->parse_string(<<EOT); <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version = "2.0"> <xsl:template match="/"> </xsl:template> </xsl:stylesheet> EOT my $stylesheet; eval { $stylesheet = XML::LibXSLT->new->parse_stylesheet($templateDoc); }; die $@ if $@; my $resultDoc = $stylesheet->transform($doc); print $stylesheet->output_string($resultDoc);
From: dcameron [...] bcs.org.uk
[guest - Wed Jan 16 14:52:19 2002]: I've just realised that the literal XML in the bug report isn't being handled correctly, so I've attached the example code Show quoted text
> Distribution XML-LibXSLT-1.31 (from Randy Kobes repository) > Perl Binary build 628 provided by ActiveState Tool Corp. > http://www.ActiveState.com > Built 15:41:05 Jul 4 2001 > > Any error in the <xsl:stylesheet> element within a stylesheet causes > LibXSLT to SEGV. This error came up on the Perl-XML list in mid- > December raised by Roger Perttu, but I thought that I'd log it here > anyway. Here's an example, I set the version to 2.0, it should be > 1.0: > > use strict; > use warnings; > > use XML::LibXML; > use XML::LibXSLT; > > my $doc = XML::LibXML->new->parse_string(<<EOT); > <?xml version="1.0"?> > <dromedaries> > </dromedaries> > EOT > > my $templateDoc = XML::LibXML->new->parse_string(<<EOT); > <?xml version='1.0'?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version = "2.0"> > <xsl:template match="/"> > </xsl:template> > </xsl:stylesheet> > EOT > > my $stylesheet; > eval { > $stylesheet = XML::LibXSLT->new->parse_stylesheet($templateDoc); > }; > > die $@ if $@; > > my $resultDoc = $stylesheet->transform($doc); > print $stylesheet->output_string($resultDoc); > >
use strict; use warnings; use XML::LibXML; use XML::LibXSLT; my $doc = XML::LibXML->new->parse_string(<<EOT); <?xml version="1.0"?> <dromedaries> </dromedaries> EOT my $templateDoc = XML::LibXML->new->parse_string(<<EOT); <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version = "2.0"> <xsl:template match="/"> </xsl:template> </xsl:stylesheet> EOT my $stylesheet; eval { $stylesheet = XML::LibXSLT->new->parse_stylesheet($templateDoc); }; die $@ if $@; my $resultDoc = $stylesheet->transform($doc); print $stylesheet->output_string($resultDoc);
Under current CVS it produces: compilation error: file unknown-000136087336 element stylesheet xsl:version: only 1.0 features are supported Also, don't worry about not seeing the XML - that appears to be an RT bug (and probably a massive cross site scripting hole, so I'll report it to the authors), and you can get around it by using the "download" link to the right of the bug report online. [guest - Wed Jan 16 14:52:19 2002]: Show quoted text
> Distribution XML-LibXSLT-1.31 (from Randy Kobes repository) > Perl Binary build 628 provided by ActiveState Tool Corp. > http://www.ActiveState.com > Built 15:41:05 Jul 4 2001 > > Any error in the <xsl:stylesheet> element within a stylesheet causes > LibXSLT to SEGV. This error came up on the Perl-XML list in mid- > December raised by Roger Perttu, but I thought that I'd log it here > anyway. Here's an example, I set the version to 2.0, it should be > 1.0: > > use strict; > use warnings; > > use XML::LibXML; > use XML::LibXSLT; > > my $doc = XML::LibXML->new->parse_string(<<EOT); > <?xml version="1.0"?> > <dromedaries> > </dromedaries> > EOT > > my $templateDoc = XML::LibXML->new->parse_string(<<EOT); > <?xml version='1.0'?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version = "2.0"> > <xsl:template match="/"> > </xsl:template> > </xsl:stylesheet> > EOT > > my $stylesheet; > eval { > $stylesheet = XML::LibXSLT->new->parse_stylesheet($templateDoc); > }; > > die $@ if $@; > > my $resultDoc = $stylesheet->transform($doc); > print $stylesheet->output_string($resultDoc); > >