cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <Giacomo.P...@pwr.ch>
Subject Re: [C2] Error in sitemap.xsl
Date Fri, 08 Sep 2000 18:00:04 GMT
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.

> 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.

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

Mime
View raw message