You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Anna Afonchenko <an...@ubaccess.com> on 2002/12/25 09:26:24 UTC

Value-substitution question

Hi All!
I want to get the http request that will provide me the URI of the file to generate (and transform).
E.g., the request that I should get will be something like cocoon/test/xml.apache.org/cocoon/faq/faq-xslt.html
My pipeline is as following:
<map:match pattern="test/**">
    <map:generate src="http://{1}" type="html"/>
    <map:transform src="test.xsl" type="xslt-saxon"/>
    <map:serialize type="xml"/>
</map:match>

Here is my problem:
The pipeline matches the given http request only if the URI has more than one slash, e.g., the previous example will work file, but if the http request is something like
cocoon/test/xml.apache.org/faq-xslt.html (only one slash in the given URI that is matched by the wildcard) then I get the error from Cocoon:
The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not found

But I can't also use only one asterisk in the pattern match, because then I will be able to match only URI's that don't contain slashes.

So please, can you tell me what is the right pattern match for the URI with any number of slashes (zero, one or more)?

Thank you very much for help.

Anna


Re: Value-substitution question

Posted by Anna Afonchenko <an...@ubaccess.com>.
Thank you Konstantin.
Now I understand it, and know how to use proper matter matches.

Thank you
Anna

----- Original Message -----
From: "Konstantin Piroumian" <kp...@apache.org>
To: <co...@xml.apache.org>
Sent: Thursday, December 26, 2002 9:41 AM
Subject: Re: Value-substitution question


From: "Anna Afonchenko" <an...@ubaccess.com>

> Oh, sorry, this is my typo.
> The error is of course
> The requested URI "/cocoon/test/xml.apache.org/faq-xslt.html" was not
found
>
> But the problem is still the same:
> ** doesn't match URI "xml.apache.org/faq-xslt.html".
> I can of course make two pipelines, one will match *, and the other will
> match **,
> but it is really strange that ** doesn't match the URI with single slash
for
> me.
> What do you mean by "something is differently resolved, if it's only 1
> slash"?
> Somebody can solve this mistery for me?

This is known behavior of "**" patterns. They match only paths, while "*"
pattern matches a file (no slashes in the name). I know this is not very
convinient to create two identical matchers, but as you could see from
sample sitemaps this is a usual situation and it's solved using two
matchers, one for "**" paths and one for "*". Another solution could be to
use the regexp matcher with an appropriate expression.

Try to raise this issue on dev list and probably this will be solved somehow
in future releases. (One of the possibilities could be to allow expressions
like "test/** | test/*" in patterns.)

Konstantin

>
> Thank you very much for your help.
> Anna
>
>
> ----- Original Message -----
> From: "Joerg Heinicke" <jo...@gmx.de>
> To: <co...@xml.apache.org>
> Sent: Wednesday, December 25, 2002 11:10 AM
> Subject: Re: Value-substitution question
>
>
> Hello Anna,
>
> I think the matcher is ok. ** matches everything on every hierarchy
> level (so 0, 1 or more slashes). It seems that something is differently
> resolved, if it's only 1 slash.
>
>  > _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
> found_
>
> Where does the "ub" come from?
>
> Regards,
>
> Joerg
>
> Anna Afonchenko wrote:
> > Hi All!
> > I want to get the http request that will provide me the URI of the file
> > to generate (and transform).
> > E.g., the request that I should get will be something like
> > cocoon/test/xml.apache.org/cocoon/faq/faq-xslt.html
> > My pipeline is as following:
> > <map:match pattern="test/**">
> >     <map:generate src="http://{1}" type="html"/>
> >     <map:transform src="test.xsl" type="xslt-saxon"/>
> >     <map:serialize type="xml"/>
> > </map:match>
> >
> > Here is my problem:
> > The pipeline matches the given http request only if the URI has more
> > than one slash, e.g., the previous example will work file, but if the
> > http request is something like
> > cocoon/test/xml.apache.org/faq-xslt.html (only one slash in the given
> > URI that is matched by the wildcard) then I get the error from Cocoon:
> > _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
> found_
> >
> > But I can't also use only one asterisk in the pattern match, because
> > then I will be able to match only URI's that don't contain slashes.
> >
> > So please, can you tell me what is the right pattern match for the URI
> > with any number of slashes (zero, one or more)?
> >
> > Thank you very much for help.
> >
> > Anna
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Value-substitution question

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Anna Afonchenko" <an...@ubaccess.com>

> Oh, sorry, this is my typo.
> The error is of course
> The requested URI "/cocoon/test/xml.apache.org/faq-xslt.html" was not
found
>
> But the problem is still the same:
> ** doesn't match URI "xml.apache.org/faq-xslt.html".
> I can of course make two pipelines, one will match *, and the other will
> match **,
> but it is really strange that ** doesn't match the URI with single slash
for
> me.
> What do you mean by "something is differently resolved, if it's only 1
> slash"?
> Somebody can solve this mistery for me?

This is known behavior of "**" patterns. They match only paths, while "*"
pattern matches a file (no slashes in the name). I know this is not very
convinient to create two identical matchers, but as you could see from
sample sitemaps this is a usual situation and it's solved using two
matchers, one for "**" paths and one for "*". Another solution could be to
use the regexp matcher with an appropriate expression.

Try to raise this issue on dev list and probably this will be solved somehow
in future releases. (One of the possibilities could be to allow expressions
like "test/** | test/*" in patterns.)

Konstantin

>
> Thank you very much for your help.
> Anna
>
>
> ----- Original Message -----
> From: "Joerg Heinicke" <jo...@gmx.de>
> To: <co...@xml.apache.org>
> Sent: Wednesday, December 25, 2002 11:10 AM
> Subject: Re: Value-substitution question
>
>
> Hello Anna,
>
> I think the matcher is ok. ** matches everything on every hierarchy
> level (so 0, 1 or more slashes). It seems that something is differently
> resolved, if it's only 1 slash.
>
>  > _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
> found_
>
> Where does the "ub" come from?
>
> Regards,
>
> Joerg
>
> Anna Afonchenko wrote:
> > Hi All!
> > I want to get the http request that will provide me the URI of the file
> > to generate (and transform).
> > E.g., the request that I should get will be something like
> > cocoon/test/xml.apache.org/cocoon/faq/faq-xslt.html
> > My pipeline is as following:
> > <map:match pattern="test/**">
> >     <map:generate src="http://{1}" type="html"/>
> >     <map:transform src="test.xsl" type="xslt-saxon"/>
> >     <map:serialize type="xml"/>
> > </map:match>
> >
> > Here is my problem:
> > The pipeline matches the given http request only if the URI has more
> > than one slash, e.g., the previous example will work file, but if the
> > http request is something like
> > cocoon/test/xml.apache.org/faq-xslt.html (only one slash in the given
> > URI that is matched by the wildcard) then I get the error from Cocoon:
> > _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
> found_
> >
> > But I can't also use only one asterisk in the pattern match, because
> > then I will be able to match only URI's that don't contain slashes.
> >
> > So please, can you tell me what is the right pattern match for the URI
> > with any number of slashes (zero, one or more)?
> >
> > Thank you very much for help.
> >
> > Anna
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Value-substitution question

Posted by Geoff Howard <co...@leverageweb.com>.
The error isn't saying that no match occurred, but that the generator
failed.  Are you certain that the resource you're trying to reach is there?
For instance, http://xml.apache.org/faq-xslt.html is non-existant, which I
would expect to give the exact error you're getting.

Geoff Howard

> -----Original Message-----
> From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
> Sent: Wednesday, December 25, 2002 12:19 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: Value-substitution question
>
>
> Anna Afonchenko wrote:
> > Oh, sorry, this is my typo.
> > The error is of course
> > The requested URI "/cocoon/test/xml.apache.org/faq-xslt.html"
> was not found
>
> Ah, ok.
>
> > But the problem is still the same:
> > ** doesn't match URI "xml.apache.org/faq-xslt.html".
> > I can of course make two pipelines, one will match *, and the other will
> > match **,
> > but it is really strange that ** doesn't match the URI with
> single slash for
> > me.
>
>
> > What do you mean by "something is differently resolved, if it's only 1
> > slash"?
>
> I thought this because of the "ub" in the error message, but if it was
> only a typo ...
>
> > Somebody can solve this mistery for me?
>
> Yes, this seems really strange. Can you furnish proof to the contrary by
> adding the matcher with pattern "test/*" after the matcher "test/**"?
> Does this work? I never had such a problem with **, so I can only guess:
> Isn't there any match pattern before "test/**", which catches the URI?
> And what do the log files say?
>
> As a consolation: For me everything looks ok ;-)
>
> Regards,
>
> Joerg
>
> > ----- Original Message -----
> > From: "Joerg Heinicke" <jo...@gmx.de>
> > To: <co...@xml.apache.org>
> > Sent: Wednesday, December 25, 2002 11:10 AM
> > Subject: Re: Value-substitution question
> >
> >
> > Hello Anna,
> >
> > I think the matcher is ok. ** matches everything on every hierarchy
> > level (so 0, 1 or more slashes). It seems that something is differently
> > resolved, if it's only 1 slash.
> >
> >  > _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
> > found_
> >
> > Where does the "ub" come from?
> >
> > Regards,
> >
> > Joerg
> >
> > Anna Afonchenko wrote:
> >
> >>Hi All!
> >>I want to get the http request that will provide me the URI of the file
> >>to generate (and transform).
> >>E.g., the request that I should get will be something like
> >>cocoon/test/xml.apache.org/cocoon/faq/faq-xslt.html
> >>My pipeline is as following:
> >><map:match pattern="test/**">
> >>    <map:generate src="http://{1}" type="html"/>
> >>    <map:transform src="test.xsl" type="xslt-saxon"/>
> >>    <map:serialize type="xml"/>
> >></map:match>
> >>
> >>Here is my problem:
> >>The pipeline matches the given http request only if the URI has more
> >>than one slash, e.g., the previous example will work file, but if the
> >>http request is something like
> >>cocoon/test/xml.apache.org/faq-xslt.html (only one slash in the given
> >>URI that is matched by the wildcard) then I get the error from Cocoon:
> >>_The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
> >
> > found_
> >
> >>But I can't also use only one asterisk in the pattern match, because
> >>then I will be able to match only URI's that don't contain slashes.
> >>
> >>So please, can you tell me what is the right pattern match for the URI
> >>with any number of slashes (zero, one or more)?
> >>
> >>Thank you very much for help.
> >>
> >>Anna
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Value-substitution question

Posted by Joerg Heinicke <jo...@gmx.de>.
Anna Afonchenko wrote:
> Oh, sorry, this is my typo.
> The error is of course
> The requested URI "/cocoon/test/xml.apache.org/faq-xslt.html" was not found

Ah, ok.

> But the problem is still the same:
> ** doesn't match URI "xml.apache.org/faq-xslt.html".
> I can of course make two pipelines, one will match *, and the other will
> match **,
> but it is really strange that ** doesn't match the URI with single slash for
> me.


> What do you mean by "something is differently resolved, if it's only 1
> slash"?

I thought this because of the "ub" in the error message, but if it was 
only a typo ...

> Somebody can solve this mistery for me?

Yes, this seems really strange. Can you furnish proof to the contrary by 
adding the matcher with pattern "test/*" after the matcher "test/**"? 
Does this work? I never had such a problem with **, so I can only guess: 
Isn't there any match pattern before "test/**", which catches the URI? 
And what do the log files say?

As a consolation: For me everything looks ok ;-)

Regards,

Joerg

> ----- Original Message -----
> From: "Joerg Heinicke" <jo...@gmx.de>
> To: <co...@xml.apache.org>
> Sent: Wednesday, December 25, 2002 11:10 AM
> Subject: Re: Value-substitution question
> 
> 
> Hello Anna,
> 
> I think the matcher is ok. ** matches everything on every hierarchy
> level (so 0, 1 or more slashes). It seems that something is differently
> resolved, if it's only 1 slash.
> 
>  > _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
> found_
> 
> Where does the "ub" come from?
> 
> Regards,
> 
> Joerg
> 
> Anna Afonchenko wrote:
> 
>>Hi All!
>>I want to get the http request that will provide me the URI of the file
>>to generate (and transform).
>>E.g., the request that I should get will be something like
>>cocoon/test/xml.apache.org/cocoon/faq/faq-xslt.html
>>My pipeline is as following:
>><map:match pattern="test/**">
>>    <map:generate src="http://{1}" type="html"/>
>>    <map:transform src="test.xsl" type="xslt-saxon"/>
>>    <map:serialize type="xml"/>
>></map:match>
>>
>>Here is my problem:
>>The pipeline matches the given http request only if the URI has more
>>than one slash, e.g., the previous example will work file, but if the
>>http request is something like
>>cocoon/test/xml.apache.org/faq-xslt.html (only one slash in the given
>>URI that is matched by the wildcard) then I get the error from Cocoon:
>>_The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
> 
> found_
> 
>>But I can't also use only one asterisk in the pattern match, because
>>then I will be able to match only URI's that don't contain slashes.
>>
>>So please, can you tell me what is the right pattern match for the URI
>>with any number of slashes (zero, one or more)?
>>
>>Thank you very much for help.
>>
>>Anna



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Value-substitution question

Posted by Anna Afonchenko <an...@ubaccess.com>.
Oh, sorry, this is my typo.
The error is of course
The requested URI "/cocoon/test/xml.apache.org/faq-xslt.html" was not found

But the problem is still the same:
** doesn't match URI "xml.apache.org/faq-xslt.html".
I can of course make two pipelines, one will match *, and the other will
match **,
but it is really strange that ** doesn't match the URI with single slash for
me.
What do you mean by "something is differently resolved, if it's only 1
slash"?
Somebody can solve this mistery for me?

Thank you very much for your help.
Anna


----- Original Message -----
From: "Joerg Heinicke" <jo...@gmx.de>
To: <co...@xml.apache.org>
Sent: Wednesday, December 25, 2002 11:10 AM
Subject: Re: Value-substitution question


Hello Anna,

I think the matcher is ok. ** matches everything on every hierarchy
level (so 0, 1 or more slashes). It seems that something is differently
resolved, if it's only 1 slash.

 > _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
found_

Where does the "ub" come from?

Regards,

Joerg

Anna Afonchenko wrote:
> Hi All!
> I want to get the http request that will provide me the URI of the file
> to generate (and transform).
> E.g., the request that I should get will be something like
> cocoon/test/xml.apache.org/cocoon/faq/faq-xslt.html
> My pipeline is as following:
> <map:match pattern="test/**">
>     <map:generate src="http://{1}" type="html"/>
>     <map:transform src="test.xsl" type="xslt-saxon"/>
>     <map:serialize type="xml"/>
> </map:match>
>
> Here is my problem:
> The pipeline matches the given http request only if the URI has more
> than one slash, e.g., the previous example will work file, but if the
> http request is something like
> cocoon/test/xml.apache.org/faq-xslt.html (only one slash in the given
> URI that is matched by the wildcard) then I get the error from Cocoon:
> _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not
found_
>
> But I can't also use only one asterisk in the pattern match, because
> then I will be able to match only URI's that don't contain slashes.
>
> So please, can you tell me what is the right pattern match for the URI
> with any number of slashes (zero, one or more)?
>
> Thank you very much for help.
>
> Anna


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Value-substitution question

Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Anna,

I think the matcher is ok. ** matches everything on every hierarchy 
level (so 0, 1 or more slashes). It seems that something is differently 
resolved, if it's only 1 slash.

 > _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not 
found_

Where does the "ub" come from?

Regards,

Joerg

Anna Afonchenko wrote:
> Hi All!
> I want to get the http request that will provide me the URI of the file 
> to generate (and transform).
> E.g., the request that I should get will be something like 
> cocoon/test/xml.apache.org/cocoon/faq/faq-xslt.html
> My pipeline is as following:
> <map:match pattern="test/**">
>     <map:generate src="http://{1}" type="html"/>
>     <map:transform src="test.xsl" type="xslt-saxon"/>
>     <map:serialize type="xml"/>
> </map:match>
>  
> Here is my problem:
> The pipeline matches the given http request only if the URI has more 
> than one slash, e.g., the previous example will work file, but if the 
> http request is something like
> cocoon/test/xml.apache.org/faq-xslt.html (only one slash in the given 
> URI that is matched by the wildcard) then I get the error from Cocoon:
> _The requested URI "/cocoon/ub/xml.apache.org/faq-xslt.html" was not found_
>  
> But I can't also use only one asterisk in the pattern match, because 
> then I will be able to match only URI's that don't contain slashes.
>  
> So please, can you tell me what is the right pattern match for the URI 
> with any number of slashes (zero, one or more)?
>  
> Thank you very much for help.
>  
> Anna


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>