Bug 11637

Summary: PROPFIND returns invalid XML
Product: Apache httpd-2 Reporter: Rob Owen <eurrow>
Component: mod_davAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: CLOSED FIXED    
Severity: normal CC: Christopher.D.Knight, julian.reschke
Priority: P3    
Version: 2.0.43   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Rob Owen 2002-08-12 16:05:08 UTC
After the following PROPPATCH, a PROPFIND on these new properties returns a 
response with invalid XML - "DOM Error: NAMESPACE_ERR: Attempt to create or 
change an object in a way which is incorrect with regard to namespaces". 

This bug could be a duplicate of 11468, but the strange namespace prefixes 
(ns272756832 and ns272756832 in this example (which should just be ns1)) are 
never declared (as opposed to declared too late in 11468).

PROPPATCH
<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:">
   <D:set>
      <D:prop>
         <YY:type xmlns:YY="http://www.sas.com/rnd/itech/WebDAV">
            <YY:p1>event</YY:p1>
            <YY:p2>high</YY:p2>
         </YY:type>
         <Z:Color 
xmlns:Z="http://www.sas.com/rnd/itech/WebDAV/">Yellow</Z:Color>
      </D:prop>
   </D:set>
</D:propertyupdate>


PROPFIND
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:ns0="DAV:" xmlns:ns1="http://www.sas.com/rnd/itech/WebDAV" 
xmlns:ns2="http://www.sas.com/rnd/itech/WebDAV/">
<D:href>/davdigest/Tests/mpptest/</D:href>
<D:propstat>
<D:prop>
<ns1:type><ns272756832:p1>event</ns272756832:p1><ns272756832:p2>high</ns2727568
32:p2></ns1:type>
<ns2:Color>Yellow</ns2:Color>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
Comment 1 Joshua Slive 2002-08-12 19:31:39 UTC
Assigning to the proper component (mod_dav).
Comment 2 Joshua Slive 2002-10-17 02:34:09 UTC
[This is a mass bug update.]
This bug reports a problem in an older version of Apache 2.
Could you please update to the most recent version and see
if you can reproduce this problem.  If the bug still exists,
please update the bug with the latest version number.  If 
the bug no longer exists, please close the bug report.

Sorry for this impersonal response, but we get many more bug
reports than our volunteers can keep up with.
Thanks for using Apache!
Comment 3 Roland Betz 2003-02-06 14:18:23 UTC
I have reproduced this bug using the latest Apache 2.0.44 (Win32).
Below is the communication protocol.
There are three requests. The first one is a OPTION request showing server info:

HTTP/1.1 200 OK
Content-Type: text/plain; charset=ISO-8859-1
MS-Author-Via: DAV
Date: Thu, 06 Feb 2003 13:11:47 GMT
Allow:
OPTIONS,GET,HEAD,POST,DELETE,TRACE,PROPFIND,PROPPATCH,COPY,MOVE,PUT,LOCK,UNLOCK
DAV: 1,2
Content-Length: 0
Server: Apache/2.0.44 (Win32) DAV/2


The second one sets a DAV:link property on some resource.
Request:
<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:">
<D:set>
<D:prop  xmlns:ns0="TENT:">
<ns0:parent><D:link xmlns:D="DAV:"
xmlns:user="TENT:"><D:src>http://thrud:8080/webdav/blubber</D:src><D:dst>http://thrud:8080</D:dst></D:link></ns0:parent>
</D:prop>
</D:set>
</D:propertyupdate>

Response:
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Date: Thu, 06 Feb 2003 13:11:49 GMT
Content-Length: 280
Server: Apache/2.0.44 (Win32) DAV/2

Response data:
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:" xmlns:ns1="TENT:" xmlns:ns0="DAV:">
<D:response>
<D:href>/webdav/blubber</D:href>
<D:propstat>
<D:prop>
<ns1:parent/>

</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>


The third one reads this property with a PROPFIND. The final response shows that
the namespaces within the property value are wrong.
Request:
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop  xmlns:ns0="TENT:">
<ns0:parent />
</D:prop></D:propfind>

Header Depth: 0
Response:
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Date: Thu, 06 Feb 2003 13:11:49 GMT
Content-Length: 435
Server: Apache/2.0.44 (Win32) DAV/2

Response data:
<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:ns0="DAV:" xmlns:ns1="TENT:">
<D:href>/webdav/blubber</D:href>
<D:propstat>
<D:prop>
<ns1:parent><ns9107104:link><ns9107104:src>http://thrud:8080/webdav/blubber</ns9107104:src><ns9107104:dst>http://thrud:8080</ns9107104:dst></ns9107104:link></ns1:parent>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>


Comment 4 Joe Orton 2003-03-18 21:03:03 UTC
*** Bug 15728 has been marked as a duplicate of this bug. ***
Comment 5 Jeff Trawick 2003-05-02 11:01:23 UTC
A fix for this from Amit Athavale has been committed to Apache 2.1-dev.
Comment 6 Greg Stein 2003-06-04 10:27:49 UTC
*** Bug 14969 has been marked as a duplicate of this bug. ***