cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@hns.com>
Subject RE: [C2] Error in sitemap.xsl
Date Mon, 11 Sep 2000 13:48:40 GMT
> -----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" :)))

Thanks,
Vadim


Mime
View raw message