Subject: | XML Test in Net-DAV-Server broken |
When updating XML-LibXML I always run the tests of all modules
depending on it. Changing vom XML-LibXML-2.0129 to 2.0130 makes
two tests of Net-DAV-Server-1.305 fail. 2.0131 has the same problem.
The problematic tests are t/server_propfind.t and t/server_propfind_lock.t.
I have looked into t/server_propfind.t. Subtest 9 parses an XML
file with $parser->parse_string( $content ). Parser is a XML::LibXML
object, error message is:
Unable to parse content:
:2: namespace error : Failed to parse QName 'D:D:'
<D:D:multistatus xmlns:D="DAV:"><D:response><D:href>/foo/</D:href><D:propstat><D
^
The content is generated with Net::DAV::Server->propfind().
my $doc = XML::LibXML::Document->new( '1.0', 'utf-8' );
my $multistat = $doc->createElement('D:multistatus');
$multistat->setAttribute( 'xmlns:D', 'DAV:' );
$doc->setDocumentElement($multistat);
...
$response->content( $doc->toString(0) );
With XML-LibXML-2.0129 the content is:
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:"><D:response><D:href>/foo/</D:href><D:propstat><D:prop><D:creationdate>2017-10-25T13:21:33</D:creationdate><D:getcontentlength/><D:getcontenttype>httpd/unix-directory</D:getcontenttype><D:getlastmodified>Wed, 25 Oct 2017 13:21:33 GMT</D:getlastmodified><D:supportedlock><D:lockentry><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype></D:lockentry></D:supportedlock><D:resourcetype><D:collection/></D:resourcetype></D:prop><D:status>HTTP/1.1 200 OK</D:status></D:propstat></D:response></D:multistatus>
With XML-LibXML-2.0131 it changed to:
<?xml version="1.0" encoding="utf-8"?>
<D:D:multistatus xmlns:D="DAV:"><D:response><D:href>/foo/</D:href><D:propstat><D:prop><D:creationdate>2017-10-25T13:45:11</D:creationdate><D:getcontentlength/><D:getcontenttype>httpd/unix-directory</D:getcontenttype><D:getlastmodified>Wed, 25 Oct 2017 13:45:11 GMT</D:getlastmodified><D:supportedlock><D:lockentry><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype></D:lockentry></D:supportedlock><D:resourcetype><D:collection/></D:resourcetype></D:prop><D:status>HTTP/1.1 200 OK</D:status></D:propstat></D:response></D:D:multistatus>
The D:D: namespace looks wrong. I suspect the bug is on the
XML-LibXML side when creating the document as it worked with the
old version.
I use Perl 5.24.3
This is perl 5, version 24, subversion 3 (v5.24.3) built for amd64-openbsd