Skip Menu |

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

Report information
The Basics
Id: 34057
Status: open
Priority: 0/
Queue: XML-Diff

People
Owner: Nobody in particular
Requestors: DOUGW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: (no value)



Passing in XML docs to old and new recieved this error upon compare: Can't locate object method "setAttribute" via package XML::LibXML::DocumentFragment" at (snip)/lib/perl5/site_perl/ 5.10.0/XML/Diff.pm line 894. I don't know if it matters, but the docs were the result of XSLT transformation from XML::LibXSLT: my $old_results = $xslt_stylesheet->transform($old_source); my $new_results = $xslt_stylesheet->transform($new_source); (old and new results are supposed to be LibXML documents) but if I output the results to a file, and xml::diff the files using the file names, it works ok: $xslt_stylesheet->output_file($old_results, $old_file_out); $xslt_stylesheet->output_file($new_results, $new_file_out);
On Thu Mar 13 14:46:19 2008, DOUGW wrote: Show quoted text
> Passing in XML docs to old and new recieved this error upon compare: > > Can't locate object method "setAttribute" via package > XML::LibXML::DocumentFragment" at (snip)/lib/perl5/site_perl/ > 5.10.0/XML/Diff.pm line 894.
sorry, actual line number is 891 in original file due to my adding some debugging statements.
Here is a test case: use XML::LibXML; use XML::Diff; my $old = <<OLD; <a> <b name="foo"/> </a> OLD my $new = <<NEW; <a> <b name="bar"/> </a> NEW my $parser = XML::LibXML->new(); my $old_doc = $parser->parse_string($old); my $new_doc = $parser->parse_string($new); my $diff = XML::Diff->new; #my $result = $diff->compare(-old => $old_doc->toString, -new => $new_doc->toString); my $result = $diff->compare(-old => $old_doc, -new => $new_doc); print $result->toString();