You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2001/11/01 22:06:21 UTC

Re: svn commit: rev 370 - trunk/subversion/mod_dav_svn

On Thu, Nov 01, 2001 at 12:54:03PM -0600, kfogel@tigris.org wrote:
>...
> @@ -101,7 +94,15 @@
>             "<S:date>%s</S:date>" DEBUG_CR
>             "<D:comment>%s</D:comment>" DEBUG_CR
>             "</S:log-item>" DEBUG_CR,
> -           rev, escaped_author->data, escaped_date->data, escaped_msg->data);
> +           rev,
> +           /* ### The `1' in the calls below means replace `"' with
> +              `"'.  This seems safe to me, since the dequoter on
> +              the other side will certainly handle it.  But is it
> +              necessary?  I dunno. */
> +           apr_xml_quote_string(lrb->pool, author, 1),
> +           apr_xml_quote_string(lrb->pool, date, 1),
> +           apr_xml_quote_string(lrb->pool, msg, 1));

The double-quote character does not need to be quoted. CDATA sections in XML
can contain (double) quotes without problem. That parameter is intended for
when you put a value into an XML *attribute*. The assumption is that you
surround the attribute vlaue with double-quotes, so all double-quotes inside
should be quoted.

For example:

  <element attr="quote "stuff" in <here>">
    but not the "stuff" in <here>
  </element>


Net result: you can (IMO, should) pass 0 for that second parameter. The
quote_string function won't have to work as hard then.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 370 - trunk/subversion/mod_dav_svn

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Gotcha, thanks for the explanation!

Greg Stein <gs...@lyra.org> writes:
> The double-quote character does not need to be quoted. CDATA sections in XML
> can contain (double) quotes without problem. That parameter is intended for
> when you put a value into an XML *attribute*. The assumption is that you
> surround the attribute vlaue with double-quotes, so all double-quotes inside
> should be quoted.
> 
> For example:
> 
>   <element attr="quote "stuff" in <here>">
>     but not the "stuff" in <here>
>   </element>
> 
> 
> Net result: you can (IMO, should) pass 0 for that second parameter. The
> quote_string function won't have to work as hard then.
> 
> Cheers,
> -g
> 
> -- 
> Greg Stein, http://www.lyra.org/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org