From dev-return-13852-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Tue Mar 08 23:10:59 2005 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 19584 invoked from network); 8 Mar 2005 23:10:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Mar 2005 23:10:58 -0000 Received: (qmail 56673 invoked by uid 500); 8 Mar 2005 23:10:55 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 56599 invoked by uid 500); 8 Mar 2005 23:10:54 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 56543 invoked by uid 99); 8 Mar 2005 23:10:54 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: 66.146.194.200 is neither permitted nor denied by domain of sussman@collab.net) Received: from sanpietro.red-bean.com (HELO sanpietro.red-bean.com) (66.146.194.200) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 08 Mar 2005 15:10:52 -0800 Received: from [192.168.1.100] (dsl092-129-143.chi1.dsl.speakeasy.net [66.92.129.143]) (authenticated bits=0) by sanpietro.red-bean.com (8.13.3/8.13.3/Debian-6) with ESMTP id j28NAlDE013998 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT); Tue, 8 Mar 2005 17:10:49 -0600 In-Reply-To: <20050308202015.GB14734@redhat.com> References: <2013efcf2a1f470a4d382fbe58ea4cd1@collab.net> <20050308202015.GB14734@redhat.com> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <2d52d9daee9c0eb29fd20c1d5b3881ae@collab.net> Content-Transfer-Encoding: 7bit Cc: dev@apr.apache.org From: Ben Collins-Sussman Subject: Re: opposite of apr_xml_quote_string() ? Date: Tue, 8 Mar 2005 17:10:46 -0600 To: Joe Orton X-Mailer: Apple Mail (2.619.2) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Mar 8, 2005, at 2:20 PM, Joe Orton wrote: > On Tue, Mar 08, 2005 at 11:41:51AM -0600, Ben Collins-Sussman wrote: >> I'm working on the svn 1.2 "locking" feature, and I've come to a point >> where mod_dav_svn needs to xml-unescape the incoming comment attached >> to a DAV lock, so that it ends up being stored in the svn repository >> as >> something human-readable. (For complex reasons, neither httpd nor >> mod_dav is xml-unescaping the data.) >> >> I've searched high and low through apr, apr-util, httpd, and svn APIs. >> I've found apr_xml_quote_string() as a nice way of xml-escaping data, >> but I've not found anything to xml-unescape. > > It's because the XML parser does it automatically; you never normally > get to see the escaped form when parsing the XML. How complex are > these > complex reasons - is the data getting XML-escaped twice, or something? > An svn client uses neon to send a DAV lock to mod_dav. mod_dav treats the field as sacred, and refuses to xml-unescape it or touch it at all. Then it hands all the fields down to mod_dav_svn. If the lock came from a generic DAV client, then mod_dav_svn stores the owner field verbatim, and retrieves it verbatim later on when asked. If the lock came from a subverison cilent, then mod_dav_svn needs to make the value palatable to the rest of subversion. Before storing in the repository, it strips away the tags, and xml-unescapes the data. (ra_dav xml-escapes this 'comment' field before sending it over neon, since neon isn't doing it.) When retrieving the lock later on, it remembers to xml-escape the data and re-add the tags, so that the http response is valid. On the client side of subversion, the lock coming back from ne_lock_discover() needs to have the owner field unescaped as well.