cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Ulrich Niedermann <>
Subject Re: [C2] Question About WildcardURIMatcher
Date Fri, 25 Aug 2000 23:46:13 GMT
Giacomo Pati <> writes:

> > Vadim Gritsenko wrote:

> > Is it OK that '<map:match pattern="welcome">' (from sitemap.xmap)
> > matches http://host/cocoon/welcome as well as
> > http://host/cocoon/zzzzzzwelcomezzzzzzzzz?
> > I mean, it should work this way or this is an error?
> Unfortunately it's the way it workes. That's why I have used the
> RegexpURIMatcher to have a way to determine start and end on a pattern
> (see my mail yesterday about this topic).
> Maybe you have a way or proposal how to fix it?

Why isnt't the pattern interpreted relatively to the base URL of the
sitemap in the first place? (I understand the cascading of sitemaps
leads to a base URL for every sitemap.) 

This would allow matching the beginning of a pattern agains the
beginning of the relative URL. If we also match the end of the
wildcard pattern against the end of the URL we get something IMHO

[ The following is not based on examination of current code and
  therefore perhaps contradicts current behaviour ("**" matching). 
  However, it may reflect the expectations of a new C2 user :-) ]

The URL would be the part of the URI in front of the first "?"
character: URI "http://xyz:80/a/b?d=e" -> URL "http:///xyz:80/a/b" 

So, if the base URL of a sitemap is http://localhost:8080/cocoon/

   matches "http://localhost:8080/cocoon/welcome"
   but not "http://localhost:8080/cocoon/mywelcomexx"

   matches "http://localhost:8080/cocoon/docs/aaa"
   but not "http://localhost:8080/cocoon/newdocs/foo"

   matches "http://localhost:8080/cocoon/docs/dirindex"
   but not "http://localhost:8080/cocoon/mydocs/dirindex"

Of course, this limits usage of the wildcard matcher to URIs of a


View raw message