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 :-)
(*) 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: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Wed Jan 12 23:50:10 2005