Bug 7836

Summary: PROPFIND response is not correct for "no namespace" properties
Product: Slide Reporter: Rob Owen <eurrow>
Component: WebDAV ServerAssignee: Slide Developer List <slide-dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: Nightly   
Target Milestone: ---   
Hardware: All   
OS: other   

Description Rob Owen 2002-04-08 14:01:31 UTC
PROPFIND does not produce the correct XML for properties that have no 
namespace. The property output ignores the namespace and the property is then 
seen to be part of the default namespace (DAV:), used on the multistatus 
element. The propperty element should reset the namespace for the property (eg. 
<propwithnons xmlns="">Value</propwithnons>).  

The following fix to org.apache.util.XMLPrinter fixes this immediate problem 
(as a result of Slide's use of a default namespace in the multistatus response).
 
--- XMLPrinter.java	Mon Apr  8 14:41:05 2002
+++ XMLPrinter.orig.java	Mon Apr  8 14:40:52 2002
@@ -1,5 +1,5 @@
 /*
- * $Header: /home/cvs/jakarta-slide/src/util/org/apache/util/XMLPrinter.java,v 
1.7 2002/03/28 06:12:06 jericho Exp $
+ * $Header: /home/cvspublic/jakarta-
slide/src/util/org/apache/util/XMLPrinter.java,v 1.7 2002/03/28 06:12:06 
jericho Exp $
  * $Revision: 1.7 $
  * $Date: 2002/03/28 06:12:06 $
  *
@@ -248,7 +248,7 @@
         } else {
             switch (type) {
             case OPENING:
-                if ((namespaceInfo != null)) {
+                if ((namespaceInfo != null) && (namespaceInfo.length()>0)) {
                     buffer.append("<" + name + " xmlns=\"" + namespaceInfo
                                   + "\">");
                 } else {
@@ -260,7 +260,7 @@
                 break;
             case NO_CONTENT:
             default:
-                if ((namespaceInfo != null)) {
+                if ((namespaceInfo != null) && (namespaceInfo.length()>0)) {
                     buffer.append("<" + name + " xmlns=\"" + namespaceInfo
                                   + "\"/>");
                 } else {
Comment 1 Oliver Zeigermann 2003-12-18 13:01:53 UTC
Seems to be outdated. Please check and resubmit if not :)