Re: Lightweight PROPFIND requests

On Tuesday, May 28, 2002, at 11:41 PM, Julian Reschke wrote:

>> From: w3c-dist-auth-request@w3.org
>> [mailto:w3c-dist-auth-request@w3.org]On Behalf Of Jim Luther
>> Sent: Wednesday, May 29, 2002 3:19 AM
>> To: w3c-dist-auth@w3.org
>> Subject: Lightweight PROPFIND requests
>>
>>
>> There are a few times when the Mac OS X WebDAV file system client needs
>> to use the PROPFIND method with "Depth: 1" on a collection resource to
>> determine if it contains any children resources. For example, POSIX
>> requires that my rmdir code must not delete a directory (collection)
>> unless it is empty. Since the WebDAV DELETE method doesn't work that 
>> way
>> (it deletes all children), my code uses the PROPFIND method with 
>> "Depth:
>> 1" to determine if the DELETE method can be called on the empty
>> collection, or if ENOTEMPTY should be returned because the collection
>> has children. I don't need any properties from that PROPFIND, just the
>> list of children.
>>
>> I tried this:
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <D:propfind xmlns:D="DAV:">
>> <D:prop>
>> </D:prop>
>> </D:propfind>
>>
>> and it works with mod_dav. However (and this is my question), is this
>> legal by the rule <!ELEMENT prop ANY>? I looked through the XML docs to
>> see how ANY was defined but couldn't tell it allowed an empty set.
>
> It's legal according to the DTD, and I don't think that RFC2518 
> explicitly
> forbids it. It certainly works with our server.
>
>> If that's illegal and I must I ask for at least one property, I'll just
>> ask for the resourcetype property since it looks like the only property
>> that MUST be defined for all DAV compliant resources (all of the other
>> DAV properties are shoulds, or are MUSTs under certain conditions).
>
> That's probably the cheapest workaround -- but I'd try to stay with the
> former solution. If this breaks somewhere, please report the issue.

I found a server which requires you to ask for at least one property... 
Microsoft-IIS/5.0 (Windows 2000 Professional). If you ask for no 
properties, it replies with "400 Bad Request". The other servers I 
tested (Apple iDisk, Xythos Sharemation, Apache 1.3/mod_dav 1.0.2, 
Greenbytes SAP Portals Enterprise Portal WebDAV Interface) all work 
correctly with no properties.

So in the name of interoperability, I'll be asking for the resourcetype 
property like this:

<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:resourcetype/>
</D:prop>
</D:propfind>

- Jim

Received on Wednesday, 29 May 2002 12:56:55 UTC