You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <vg...@hns.com> on 2000/09/08 18:42:34 UTC
[C2] Error in sitemap.xsl
Hi,
There is an error in sitemap.xsl, in call to translate() function. Third
argument should have
the same length as second argument.
Because of this error, sitemap makes same variable names/methods for
matchers like "foo.*" and "foo/*".
Patch is attached.
Regards,
Vadim
Re: [C2] Error in sitemap.xsl
Posted by Giacomo Pati <Gi...@pwr.ch>.
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
RE: [C2] Error in sitemap.xsl
Posted by Vadim Gritsenko <vg...@hns.com>.
> -----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
Re: [C2] Error in sitemap.xsl
Posted by Giacomo Pati <Gi...@pwr.ch>.
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