The following change addresses an issue that was pointed out on the
slide users mailer - the command line client returns an empty string for
XML valued properties (getPropertyAsString for BaseProperty just calls
DOMUtils.getTextValue(element)).
Changing the getPropertyAsString method in
org.apache.webdav.lib.BaseProperty.java
From:
return DOMUtils.getTextValue(element);
To:
StringWriter sw = new StringWriter();
PropertyWriter pw = new PropertyWriter( sw, false);
NodeList children = element.getChildNodes();
if (children == null || children.getLength() == 0) {
return DOMUtils.getTextValue(element);
} else {
for (int i = 0; i < children.getLength(); i++) {
Node child = (Node) children.item(i);
pw.print(child);
}
}
return sw.toString();
will print text or XML values as text. This is primarily useful for the
command line client, but it doesn't seem like an unreasonable thing to
do within the library itself.
(getPropertyAsString is really display oriented anyway since the
subclasses of BaseProperty override it to pretty print their XML -
changing BaseProperty just makes it possible to see XML values of non
DAV properties without having to add new classes. )
Jim
James D. Myers
Chief Scientist, Scientific Computing Environments Group
Computational Science and Mathematics Department
Pacific Northwest National Laboratory
Phone: 610-355-0994
Fax: 208-474-4616
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]