[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: DAV locking question

From: Greg Stein <gstein_at_lyra.org>
Date: 2005-01-12 23:52:33 CET

On Wed, Jan 12, 2005 at 11:16:22PM +0100, Julian Reschke wrote:
> Ben Collins-Sussman wrote:
>...
> >It seems totally wrong for a client to use the <DAV:owner> as a place to
> >store attributes and private namespaces that apply to the tag's
> >contents. Clients that do this are placing a ridiculous burden on DAV
> >servers, no? If the client demands that the server preserve these
> >namespaces outside of the content, then the server should be able to
> >"push" the namespaces down into the content when convenient.

Take a look at the code. mod_dav *does* push the namespaces down. It
properly retains all the namespaces, the xml:lang value that applies
to the DAV:owner element, all the attributes of the DAV:owner
element(*), and all the inner elements/cdata.

Go ahead and declare a custom namespace three levels up. It'll show up
on that DAV:owner element.

> >But then
> >on the other hand, the server is supposed to treat the content
> >opaquely... so it can't assume the content is XML.
>
> The content *by definition* is XML (or more precisely an XML fragment).

Right. Therefore, I have a precise definition of how to push
namespaces and xml:lang values down.

> >What if the <DAV:owner> content is using namespaces defined 2 levels
> >up? Does the server have to preserve those namespaces too? Where do we
> >draw the line?

No problem. Yes. And the line is where Julian says: round trip the
value. The text does not have to precisely match -- this is XML. In
mod_dav's case, it will rewrite the namespace prefixes, and add more
gunk onto the DAV:owner element, but these are all valid transforms of
the XML which was provided.

>...

The DAV:owner element surrounds the contents because I use that hold
the namespace and xml:lang definitions. It also makes it very easy to
return that element in response: just memcpy() the whole thing since
it is a self-contained unit. I don't have to worry about proper
assembly of XML elements and storing namespace declarations somewhere,
and all that other gunk.

I kind of liked the solution :-)

Cheers,
-g

(*) there was discussion at one point on whether attributes on a
  property name are considered part of the property or not; mod_dav
  assumes they are and preserves them; the same logic was applied to
  the DAV:owner element.

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jan 12 23:50:10 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.