Debugging namespace change, with updated regression results.

This commit is contained in:
Andrew McMillan 2007-11-23 23:32:05 +13:00
parent ad17ee8a2b
commit 552bb6f0e8
14 changed files with 92 additions and 91 deletions

View File

@ -48,7 +48,7 @@ function add_namespace( $prefix, $namespace ) {
function ns_tag( $in_tag, $namespace=null, $prefix=null ) { function ns_tag( $in_tag, $namespace=null, $prefix=null ) {
global $namespaces; global $namespaces, $prefixes;
if ( $namespace == null ) { if ( $namespace == null ) {
// Attempt to split out from namespace:tag // Attempt to split out from namespace:tag
@ -65,6 +65,7 @@ function ns_tag( $in_tag, $namespace=null, $prefix=null ) {
$tag = $in_tag; $tag = $in_tag;
} }
$namespace = strtolower($namespace); $namespace = strtolower($namespace);
if ( $namespace == 'dav:' ) $namespace = 'DAV:'; // Special case for conventional naming
$tag = strtolower($tag); $tag = strtolower($tag);
if ( $prefix == null ) { if ( $prefix == null ) {
@ -83,7 +84,7 @@ function ns_tag( $in_tag, $namespace=null, $prefix=null ) {
} }
$i = ""; $i = "";
if ( isset($prefixes[$prefix]) ) { if ( isset($prefixes[$prefix]) ) {
for ( $i=1; $i<20 && isset($prefixes["$prefix$i"]); $i++ ) { for ( $i=1; $i<10 && isset($prefixes["$prefix$i"]); $i++ ) {
} }
} }
if ( isset($prefixes["$prefix$i"]) ) { if ( isset($prefixes["$prefix$i"]) ) {
@ -100,7 +101,7 @@ function ns_tag( $in_tag, $namespace=null, $prefix=null ) {
add_namespace( $prefix, $namespace ); add_namespace( $prefix, $namespace );
} }
return $prefix . ":" . $tag; return $prefix . ($prefix == "" ? "" : ":") . $tag;
} }

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> <multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:A="http://apache.org/dav/props/">
<response> <response>
<href>http://mycaldav/caldav.php/user1/home/</href> <href>http://mycaldav/caldav.php/user1/home/</href>
<propstat> <propstat>
@ -15,9 +15,9 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<executable xmlns="http://apache.org/dav/props/"/> <A:executable/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -1,12 +1,12 @@
HTTP/1.1 207 Multi-Status HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, access-control, calendar-access DAV: 1, 2, access-control, calendar-access
ETag: "455c90fdc59860d7dfa851ad1f75b4ba" ETag: "58323b4af2f8d17c9fd4412652c18a5c"
Content-Length: 847 Content-Length: 746
Content-Type: text/xml; charset="utf-8" Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> <multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:C1="http://calendarserver.org/ns/">
<response> <response>
<href>/caldav.php/user1/home/</href> <href>/caldav.php/user1/home/</href>
<propstat> <propstat>
@ -23,10 +23,10 @@ Content-Type: text/xml; charset="utf-8"
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<schedule-inbox-url xmlns="urn:ietf:params:xml:ns:caldav"/> <C:schedule-inbox-url/>
<schedule-outbox-url xmlns="urn:ietf:params:xml:ns:caldav"/> <C:schedule-outbox-url/>
<dropbox-home-url xmlns="http://calendarserver.org/ns/"/> <C1:dropbox-home-url/>
<notifications-url xmlns="http://calendarserver.org/ns/"/> <C1:notifications-url/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -1,12 +1,12 @@
HTTP/1.1 207 Multi-Status HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, access-control, calendar-access DAV: 1, 2, access-control, calendar-access
ETag: "3c6167921378348411a110b1db03b7d4" ETag: "d595bef8c261fd561df6bb7eec2f3734"
Content-Length: 796 Content-Length: 659
Content-Type: text/xml; charset="utf-8" Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> <multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:C1="http://calendarserver.org/ns/">
<response> <response>
<href>/</href> <href>/</href>
<propstat> <propstat>
@ -20,11 +20,11 @@ Content-Type: text/xml; charset="utf-8"
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<calendar-user-address-set xmlns="urn:ietf:params:xml:ns:caldav"/> <C:calendar-user-address-set/>
<schedule-inbox-url xmlns="urn:ietf:params:xml:ns:caldav"/> <C:schedule-inbox-url/>
<schedule-outbox-url xmlns="urn:ietf:params:xml:ns:caldav"/> <C:schedule-outbox-url/>
<dropbox-home-url xmlns="http://calendarserver.org/ns/"/> <C1:dropbox-home-url/>
<notifications-url xmlns="http://calendarserver.org/ns/"/> <C1:notifications-url/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -1,12 +1,12 @@
HTTP/1.1 207 Multi-Status HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, access-control, calendar-access DAV: 1, 2, access-control, calendar-access
ETag: "f501a70013d679ecd57dc0981fdb62e1" ETag: "abe3054a40d9f860fe9ccabef5e558db"
Content-Length: 5847 Content-Length: 5725
Content-Type: text/xml; charset="utf-8" Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> <multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:A="http://apple.com/ns/calendarserver/">
<response> <response>
<href>/caldav.php/user1/</href> <href>/caldav.php/user1/</href>
<propstat> <propstat>
@ -22,8 +22,8 @@ Content-Type: text/xml; charset="utf-8"
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<dropbox-home-url xmlns="http://apple.com/ns/calendarserver/"/> <A:dropbox-home-url/>
<notifications-url xmlns="http://apple.com/ns/calendarserver/"/> <A:notifications-url/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>
@ -43,8 +43,8 @@ Content-Type: text/xml; charset="utf-8"
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<dropbox-home-url xmlns="http://apple.com/ns/calendarserver/"/> <A:dropbox-home-url/>
<notifications-url xmlns="http://apple.com/ns/calendarserver/"/> <A:notifications-url/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -1,12 +1,12 @@
HTTP/1.1 207 Multi-Status HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, access-control, calendar-access DAV: 1, 2, access-control, calendar-access
ETag: "82a2af4a319c7702f65e131574e63754" ETag: "461b0f96e42a2b69d256b99bc8d2ea1e"
Content-Length: 1261 Content-Length: 1139
Content-Type: text/xml; charset="utf-8" Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> <multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:A="http://apple.com/ns/calendarserver/">
<response> <response>
<href>/caldav.php/user1/</href> <href>/caldav.php/user1/</href>
<propstat> <propstat>
@ -22,8 +22,8 @@ Content-Type: text/xml; charset="utf-8"
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<dropbox-home-url xmlns="http://apple.com/ns/calendarserver/"/> <A:dropbox-home-url/>
<notifications-url xmlns="http://apple.com/ns/calendarserver/"/> <A:notifications-url/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>
@ -43,8 +43,8 @@ Content-Type: text/xml; charset="utf-8"
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<dropbox-home-url xmlns="http://apple.com/ns/calendarserver/"/> <A:dropbox-home-url/>
<notifications-url xmlns="http://apple.com/ns/calendarserver/"/> <A:notifications-url/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -1,12 +1,12 @@
HTTP/1.1 207 Multi-Status HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, access-control, calendar-access DAV: 1, 2, access-control, calendar-access
ETag: "c240d5bc59682fd96a47d4b802052879" ETag: "f90fce514cd7d7155fcb48f704e9f171"
Content-Length: 689 Content-Length: 651
Content-Type: text/xml; charset="utf-8" Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> <multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:A="http://apple.com/ns/calendarserver/">
<response> <response>
<href>/caldav.php/user1/</href> <href>/caldav.php/user1/</href>
<propstat> <propstat>
@ -22,8 +22,8 @@ Content-Type: text/xml; charset="utf-8"
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<dropbox-home-url xmlns="http://apple.com/ns/calendarserver/"/> <A:dropbox-home-url/>
<notifications-url xmlns="http://apple.com/ns/calendarserver/"/> <A:notifications-url/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -39,10 +39,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -2,7 +2,7 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, access-control, calendar-access DAV: 1, 2, access-control, calendar-access
ETag: "deadbeefcafefeeddeadbeefcafefeed" ETag: "deadbeefcafefeeddeadbeefcafefeed"
Content-Length: 1219 Content-Length: 1141
Content-Type: text/xml; charset="utf-8" Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
@ -37,12 +37,12 @@ Content-Type: text/xml; charset="utf-8"
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
<bogus-property xmlns="dav:"/> <bogus-property/>
<contentbogosity xmlns="dav:"/> <contentbogosity/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -30,10 +30,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -38,10 +38,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -38,10 +38,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>
@ -85,10 +85,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>
@ -132,10 +132,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>
@ -179,10 +179,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>
@ -226,10 +226,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>
@ -273,10 +273,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> <multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:R="urn:mcmillan:bogus:xml:ns:rscds">
<response> <response>
<href>http://mycaldav/caldav.php/user1/home/</href> <href>http://mycaldav/caldav.php/user1/home/</href>
<propstat> <propstat>
<prop> <prop>
<displayname>User One's Calendar</displayname> <displayname>User One's Calendar</displayname>
<arbitrary xmlns="urn:mcmillan:bogus:xml:ns:rscds">A completely bogus property which should be saved.</arbitrary> <R:arbitrary>A completely bogus property which should be saved.</R:arbitrary>
</prop> </prop>
<status>HTTP/1.1 200 OK</status> <status>HTTP/1.1 200 OK</status>
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<owner xmlns="dav:"/> <owner/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>

View File

@ -39,10 +39,10 @@
</propstat> </propstat>
<propstat> <propstat>
<prop> <prop>
<lockdiscovery xmlns="dav:"/> <lockdiscovery/>
<source xmlns="dav:"/> <source/>
<checked-in xmlns="dav:"/> <checked-in/>
<checked-out xmlns="dav:"/> <checked-out/>
</prop> </prop>
<status>HTTP/1.1 404 Not Found</status> <status>HTTP/1.1 404 Not Found</status>
</propstat> </propstat>