Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 97319 invoked from network); 11 Sep 2000 19:49:44 -0000 Received: from galaxia.dataway.ch (qmailr@195.216.80.32) by locus.apache.org with SMTP; 11 Sep 2000 19:49:44 -0000 Received: (qmail 16435 invoked from network); 11 Sep 2000 19:49:37 -0000 X-dataway-Spamcheck: 195.216.80.129: RBL=- DUL=- RSS=- ORBS=- Received: from unknown (HELO pwr.ch) (195.216.80.129) by galaxia.dataway.ch with SMTP; 11 Sep 2000 19:49:37 -0000 Received: (qmail 1412 invoked from network); 11 Sep 2000 19:34:26 -0000 Received: from donald.pwr.ch (HELO pwr.ch) (10.20.30.103) by simba.pwr.ch with SMTP; 11 Sep 2000 19:34:26 -0000 Sender: giacomo Message-ID: <39BD33C6.F4BE65CF@pwr.ch> Date: Mon, 11 Sep 2000 21:34:30 +0200 From: Giacomo Pati Organization: PWR Organisation & Entwicklung X-Mailer: Mozilla 4.74 [en] (X11; U; Linux 2.2.16 i686) X-Accept-Language: de-DE, de-CH, en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: [C2] Error in sitemap.xsl References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Vadim Gritsenko wrote: > > > -----Original Message----- > > From: giacomo@uunet.uu.net [mailto:giacomo@uunet.uu.net]On Behalf > > Of Giacomo Pati > > Sent: Friday, September 08, 2000 2:00 PM > > To: cocoon-dev@xml.apache.org > > Subject: Re: [C2] Error in sitemap.xsl > > > > > > Vadim Gritsenko wrote: > > > > > > Hi, > > > > > > There is an error in sitemap.xsl, in call to translate() function. Third > > > argument should have > > > the same length as second argument. > > > > An excerpt from the XPath spec section 4.2: > > > > ----------------------------<<>>---------------------------- > > > > Function: string translate(string, string, string) > > > > The translate function returns the first argument string with > > occurrences of characters in the second argument string replaced by the > > character at the corresponding position in the third argument string. > > For example, translate("bar","abc","ABC") returns the string BAr. If > > there is a character in the second argument string with no character at > > a corresponding position in the third argument string (because the > > second argument string is longer than the third argument string), then > > occurrences of that character in the first argument string are removed. > > For example, translate("--aaa--","abc-","ABC") returns "AAA". If a > > character occurs more than once in the second argument string, then the > > first occurrence determines the replacement character. If the third > > argument string is longer than the second argument string, then excess > > characters are ignored. > > > > ----------------------------<<>>---------------------------- > > > > There is no need for the third argument to the translate function to be > > of the same length as the second argument. > > I know, I know... > Actually, I read this before writing a patch :))) > > > > > > Because of this error, sitemap makes same variable names/methods for > > > matchers like "foo.*" and "foo/*". > > > > Yes, this is a problem. Thanks for tha patch. I'll apply them soon. > > That's why I wrote "should" - but not "must" :))) Sorry, I should have to read mail more slowly :). But I think there is still a potential problem with that algorithm. I should use a xslt java extionsion object to do bookkeeping of that names to prevent name collisions. Giacomo -- PWR GmbH, Organisation & Entwicklung Tel: +41 (0)1 856 2202 Giacomo Pati, CTO/CEO Fax: +41 (0)1 856 2201 Hintereichenstrasse 7 Mobil: +41 (0)78 759 7703 CH-8166 Niederweningen Mailto:Giacomo.Pati@pwr.ch Web: http://www.pwr.ch