Skip Menu | will be shut down on March 1st, 2021.

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

Report information
The Basics
Id: 58190
Status: resolved
Priority: 0/
Queue: XML-LibXML

Owner: Nobody in particular
Requestors: dcardwell [...]

Bug Information
Severity: (no value)
Broken in: 1.70
Fixed in: (no value)

Subject: ->load_xml and XML::LibXML::InputCallback
Download (untitled) / with headers
text/plain 514b
I recently upgraded to XML::LibXML 1.70 and noticed the addition of the ->load_xml method. When using this in conjunction with the `location` parameter to load an external file it seems to ignore the InputCallback that was previously working fine with the ->parse_file method. I have attached a short test case to this e-mail. When the file is read in with ->parse_file a warning is generated in the InputCallback, however the warning is not triggered with - Show quoted text
>load_xml. Should it be, or am I missing something?
text/x-perl 671b
#!/usr/bin/perl -wT use strict; use warnings; use XML::LibXML; die 'This test case is for XML::LibXML v1.70' unless $XML::LibXML::VERSION eq '1.70'; my $input_callbacks = XML::LibXML::InputCallback->new(); $input_callbacks->register_callbacks([ sub { 1 }, sub { warn 'Input callback used'; open my $fh, '<', shift; return $fh; }, sub { my $buffer; read(shift, $buffer, shift); return $buffer; }, sub { close shift }, ]); my $xml_parser = XML::LibXML->new(); $xml_parser->input_callbacks($input_callbacks); warn "->parse_file:\n"; $xml_parser->parse_file('testcase.xml'); warn "->load_xml:\n"; $xml_parser->load_xml(location => 'testcase.xml');
Subject: testcase.xml
Download testcase.xml
text/xml 46b
<?xml version="1.0" encoding="utf-8"?> <foo/>
Download (untitled) / with headers
text/plain 322b
Thanks for the report: - Fix the handling of XML::LibXML::InputCallbacks at load_xml(). - - The problem was that the input callbacks were not cloned in _clone(). This is fixed in the repository and will be uploaded to CPAN in the next release.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to