in reply to Problems with XML::LibXML

First of all, congratulations for taking the initiative to write tests. There will be a Perl.com article that goes into more detail on this very soon.

I'm seeing the same results that you are. Let's take a look at the failures:

# test six my $par = $doc->createElement('Paragraph'); is( $par->ownerDocument(), $doc, 'Element has correct owner'); not ok 6 - Element has correct owner # Failed test (t/docutest.t at line 18) # got: 'XML::LibXML::DocumentFragment=SCALAR(0x80b5b68)' # expected: 'XML::LibXML::Document=SCALAR(0x804b688)'
Evidently the paragraph node is attached to a DocumentFragment. Setting the Paragraph as the Document's root element fixes tests 6 and 7, as well as the segfault and test 17:
$doc->setDocumentElement($par); is( $par->ownerDocument(), $doc, 'Element has correct owner');
As for the other tests, a little playing around got better results for me. Then I broke them again. I think you may be misunderstanding the DOM. I sure am. Maybe the libxml documentation will shed more light on the subject. Or mirod or Matt Sergeant will show up.