- From: Greg Stein <gstein@lyra.org>
- Date: Mon, 5 Feb 2001 19:19:12 -0800
- To: ietf-dav-versioning@w3.org
On Mon, Feb 05, 2001 at 04:21:11PM -0500, Geoffrey M. Clemm wrote:
>...
> As a reminder, this argument says that "if XML validation succeeds, it
> has no effect on processing of a message, and if XML validation fails,
> but the message can be understood by the message processor, a
> forgiving message processor will go ahead and process the message
> anyway."
Agreed!
> So given the cost of passing a DTD along with a message, or
> the cost to a server of accessing any remote DTD that it doesn't have
> cached locally, I see no evidence that many server writers will bother
> with validation, or care about the results even if they did validate.
mod_dav (and, therefore, Apache 2.0 and later) will never do DTD validation
on the incoming requests. The XML is parsed (and checked that it is
well-formed), but the code that tears up the elements is more than
sufficient for detecting improper usage / violations of the expected element
construction. An XML validator won't assist that in any way.
I'm still going to write code like:
/* get the label string */
if ((child = dav_find_child(elem, "label-name")) == NULL) {
ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r,
"The label command element does not contain "
"a \"label-name\" element.");
return HTTP_BAD_REQUEST;
}
Why use a validator when an "if" command during processing does the same
thing, and can give me a very nice error message?
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
Received on Monday, 5 February 2001 22:17:59 UTC