Subject: [Bug 10] Round-tripping namespace decls in properties

From: [email-masked]
Date: Wed, 7 Dec 2005 18:51:02 -0800

http://ietf.cse.ucsc.edu:8080/bugzilla/show_bug.cgi?id=10

------- Additional Comments From [email-masked]  2005-12-07 18:51 -------
I still maintain that it is unreasonable to require a server to preserve namespace prefixes.  WebDAV 
requires that server authors understand XML and XML namespaces.

Adding requirements imposed by additional specifications (XSLT, etc.) puts an undo burden on server 
authors, given that some XML libraries, when asked to simply read XML into a DOM and then render 
that XML *do* rewrite namespace prefixes.  If a server author can't simply ask a library to render the 
XML and instead has to dive into the innards of the library or write their own renderer, you've obviated 
the alleged value of using XML in the first place.  Dealing with XML in WebDAV is hard enough as things 
are.

This is especially bothersome given that if a client cares about preserving XML exactly as given, than a 
simple encoding of the XML will guarantee that, and the server can remain blissfully ignorant of that 
content.  If you instead put the XML elements in a property, the server *has to* parse them, and clients 
should be willing to accept the consequenses of that.

------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

---

From: Julian Reschke <[email-masked]>
Date: Fri, 09 Dec 2005 11:01:36 +0100

Wilfredo,

thanks for the feedback. In our conference call, when we discussed this, 
the rational was that if we want server implementors to implement this 
at some point int the future, we need to tell them now. This is not 
extraordinary when upgrading specs.

> requires that server authors understand XML and XML namespaces.

That is correct.

> authors, given that some XML libraries, when asked to simply read XML into a DOM and then render 

I think this is a misunderstanding. Preserving prefixes is not "imposed" 
by additional specifications. There was never any W3C spec that said 
that prefixes are irrelevant (or, if there is, please let me know).

> the alleged value of using XML in the first place.  Dealing with XML in WebDAV is hard enough as things 

Yes, and I confess that some years ago, I wrote a library in which I 
also deliberately threw away prefixes.

On the other hand, I really can't think of any W3C spec that licenses 
parsers or serializers to throw out prefix information. Server 
implementors will just have to make sure that the libraries they use 
work properly (just as for other less-well understood XML features).

> should be willing to accept the consequenses of that.

Escaping XML so it becomes string data solves one problem, but creates 
lots of others (including weird display in generic clients, and 
surprising results in SEARCH requests). So I really don't buy in it 
being a proper solution to this problem in the generic case.

Best regards, Julian

---

From: Geoffrey M Clemm <[email-masked]>
Date: Fri, 9 Dec 2005 08:29:08 -0500

> being a proper solution to this problem in the generic case.

In addition, whatever body defined that property would have to very
clearly and very explicitly state that this property never
takes a top-level escaped string as a value, and that when an escaped
string is returned for that property value, the client should unescape the 
string 
before processing the value.  Unless this is done, even non-generic
clients that are specifically written to understand that property will
fail to unescape the string (resulting in even more serious consequences
that for a generic client, since a generic client at least won't try to
do any significant processing of the value).

So escaping the XML is not something that a client writer can do to 
address
this problem ... it would have to be the property definer (and even then,
you are likely to get many clients that neglect to do the unescaping).

Cheers,
Geoff

---

From: Jim Whitehead <[email-masked]>
Date: Fri, 9 Dec 2005 10:06:56 -0800

Wilfredo writes:

>> I still maintain that it is unreasonable to require a server to  
>> preserve namespace prefixes.  WebDAV requires that server authors  
>> understand XML and XML namespaces.

I'd like to better understand what the perceived implementation  
issues are.

One issue we create by preserving namespaces is the potential for  
inconsistency.

Consider:

Request A uses namespace mapping foo="http://www.webdav.org/" and  
sets the value of property foo:prop1 using it.

Request B uses namespace mapping foo="http://www.ucsc.edu/" and sets  
the value of property foo:prop2 using it.

Request C requests properties prop1 and prop2.

Servers could handle this by using appropriately scoped namespace  
declarations. It would involve a change in XML handling for some  
servers that put all namespace declarations at the beginning of the  
multistatus XML response.

>
>> This is especially bothersome given that if a client cares about  
>> preserving XML exactly as given, than a simple encoding of the XML  
>> will guarantee that, and the server can remain blissfully ignorant  
>> of that content.  If you instead put the XML elements in a  
>> property, the server *has to* parse them, and clients should be  
>> willing to accept the consequenses of that.
>
> Escaping XML so it becomes string data solves one problem, but  
> creates lots of others (including weird display in generic clients,  
> and surprising results in SEARCH requests). So I really don't buy  
> in it being a proper solution to this problem in the generic case.

I agree.

- Jim

---

From: Julian Reschke <[email-masked]>
Date: Fri, 09 Dec 2005 19:35:56 +0100

Jim Whitehead wrote:
> I'd like to better understand what the perceived implementation issues are.
> 
> Request A uses namespace mapping foo="http://www.webdav.org/" and sets 
> the value of property foo:prop1 using it.
> 
> Request B uses namespace mapping foo="http://www.ucsc.edu/" and sets the 
> value of property foo:prop2 using it.
> 
> declarations. It would involve a change in XML handling for some servers 
> that put all namespace declarations at the beginning of the multistatus 
> XML response.

Jim, this is a non-issue. Nobody has asked for preserving namespace 
prefixes for the property element itself.

 > ...

Best regards, Julian