Help save net neutrality! Learn more.
Close

#12 Can't call method

closed-fixed
nobody
None
5
2004-04-02
2004-04-02
No

If you make a XML::XSLT->new(..) followed by a dispose
you will get the following error:

Can't call method "dispose" on an undefined value at
C:/PERL/site/lib/XML/XSLT.pm line 1091.

If you execute a transform before the dispose it will
work.

-------------------------------------------------------
--

use strict;
use XML::XSLT;

my $xsl = "D:/test/HTML.xsl";
my $xmlfile = "D:/test/attributes.xml";

my $xslurl = makeURL($xsl);
my $xmlurl = makeURL($xmlfile);

my $xslt = XML::XSLT->new ($xslurl, warnings => 1);

#$xslt->open_xsl($xslurl);
#$xslt->transform($xmlurl);
#print $xslt->toString;

$xslt->dispose();

0;

sub makeURL {
my $string = shift;

if( $string =~ m|^file\://|i ) { return $string; } #
if already URL format
$string =~ s|\\|\/|g; # replace \\ $string =~ s/\:/\|/o; # replace :
return "FILE://".$string; # add file://
}

Discussion

  • Jonathan Stowe

    Jonathan Stowe - 2004-04-02
    • summary: Can't call method "dispose" on an undefined value --> Can't call method
    • status: open --> closed-fixed
     
  • Jonathan Stowe

    Jonathan Stowe - 2004-04-02

    Logged In: YES
    user_id=313586

    Yes,
    Iam aware of this - it is because it wasn't checking whether
    the XML::DOM objects for the result document and the XML
    input had been created - this now is fixed in the CVS.

     

Log in to post a comment.