You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2004/01/14 23:56:13 UTC

"not so many levels" error?

Dear All,

I have this (verbatim) in my sitemap:

         <map:match pattern="*">
           <map:parameter name="foo" value="{1}"/>
         </map:match>

...and I see:

	Error while evaluating '{1}' : not so many levels

So what am I not getting?

thx,
~ML
  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "not so many levels" error?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 14.01.2004 23:56, Mark Lundquist wrote:

> Dear All,
> 
> I have this (verbatim) in my sitemap:
> 
>         <map:match pattern="*">
>           <map:parameter name="foo" value="{1}"/>
>         </map:match>
> 
> ...and I see:
> 
>     Error while evaluating '{1}' : not so many levels
> 
> So what am I not getting?

The map:parameter belongs directly to the map:match. {1} so refers to 
something outside of map:match. And as there is nothing outside of 
map:match you get this exception.

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "not so many levels" error?

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 14, 2004, at 6:41 PM, Geoff Howard wrote:

> Joerg Heinicke wrote:
>
>> What *are* you trying to do? "Capture one of the matches into a 
>> parameter" is your solution to your problem. But what's your problem?
>> Please don't feel offended, but again I must say you are thinking a 
>> programming way, but the sitemap is declarative. It just does not 
>> work this way.
>
> Well, it depends on what "later" means.  If you mean add it to a 
> session  variable, or put it out on the file system that's true.  But 
> maybe you meant just later in the same pipeline declaration (even if 
> nested in other matchers/selectors/actions).

yes — that's exactly what I meant: "later in the same pipeline 
declaration".

See, I was taking the declarative way of thinking for granted :-) and 
it didn't occur to me to qualify my language...

thanks guys for helping a noob along...
~ml


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "not so many levels" error?

Posted by Geoff Howard <co...@leverageweb.com>.
Joerg Heinicke wrote:

> On 15.01.2004 02:01, Mark Lundquist wrote:
> 
>>>>         <map:match pattern="*">
>>>>           <map:parameter name="foo" value="{1}"/>
>>>>         </map:match>
>>>> ...and I see:
>>>>     Error while evaluating '{1}' : not so many levels
>>>> So what am I not getting?
>>>
>>>
>>>
>>> Humm,, with that syntax you are sending the parameter to the matcher.
>>
>>
>>
>> D'oh!
>>
>> I know exactly what that syntax does when I'm *trying* to do something 
>> like that :-)
>>
>>>  Are you actually trying to send the parameter to a generator?
>>>
>>
>> No, I'm not.  What I really wanted to do was to capture one of the 
>> matches into a parameter that I could then reference later on.
>>
>> For one thing, I was confusing 'parameter' a la <map:parameter> with 
>> the parameters in the Map object returned by matchers and actions...
>>
>> But is there a way to do what I was trying to do?
> 
> 
> What *are* you trying to do? "Capture one of the matches into a 
> parameter" is your solution to your problem. But what's your problem?
> 
> Please don't feel offended, but again I must say you are thinking a 
> programming way, but the sitemap is declarative. It just does not work 
> this way.

Well, it depends on what "later" means.  If you mean add it to a session 
  variable, or put it out on the file system that's true.  But maybe you 
meant just later in the same pipeline declaration (even if nested in 
other matchers/selectors/actions).  Then you'd just use the ../ back 
references to get back to the right "nesting level" for that sitemap param.

Otherwise, use flow or action.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "not so many levels" error?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 15.01.2004 04:13, Mark Lundquist wrote:

>> Please don't feel offended,
> 
> Not at all! :-)
> 
>> but again I must say you are thinking a programming way, but the 
>> sitemap is declarative. It just does not work this way.
> 
> 
> If I were trying to do something iterative or stateful, yes... but all 
> I'm really after is not a variable — as in an in imperative language — 
> but rather a name binding (like XSLT "variables", which are really 
> constants).  Renaming semantics are a useful convenience in declarative 
> systems.  It's such a universal concept in computing that I didn't think 
> I needed a real "problem" to ask about it :-) (although I just saw a 
> reply from another poster that suggests that my language: "refer to it 
> later" was vague and lends itself to a different interpretation, viz. 
> that of explicit state to be read from somewhere else, like a different 
> pipeline, or whatever).

If I knew you already have XSLT background ...

Yes, indeed, if you only wanted to use that in XSLT way, it's not 
programmatic. But variables in XSLT is not more than convenience, is it? 
You just store something to reuse it more often or to shorten an 
expression. Now comparing it to the sitemap what do you want to store 
here? What has to be simplified? There are no "calculations" in it - 
besides the input modules where you can also use XSLT functions like 
translate() or similar. So IMO the usefulness is more limited than in 
XSLT, you do not really need it, do you?

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "not so many levels" error?

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 14, 2004, at 5:24 PM, Joerg Heinicke wrote:

>
> What *are* you trying to do? "Capture one of the matches into a 
> parameter" is your solution to your problem. But what's your problem?

Hmm... quite honestly, I can't remember... :-)  It seems to have been 
overtaken by events — either I solved it another way, or I decided it 
wasn't a big deal.

>
> Please don't feel offended,

Not at all! :-)

> but again I must say you are thinking a programming way, but the 
> sitemap is declarative. It just does not work this way.

If I were trying to do something iterative or stateful, yes... but all 
I'm really after is not a variable — as in an in imperative language — 
but rather a name binding (like XSLT "variables", which are really 
constants).  Renaming semantics are a useful convenience in declarative 
systems.  It's such a universal concept in computing that I didn't 
think I needed a real "problem" to ask about it :-) (although I just 
saw a reply from another poster that suggests that my language: "refer 
to it later" was vague and lends itself to a different interpretation, 
viz. that of explicit state to be read from somewhere else, like a 
different pipeline, or whatever).

Thanks!
~ml


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "not so many levels" error?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 15.01.2004 02:01, Mark Lundquist wrote:

>>>         <map:match pattern="*">
>>>           <map:parameter name="foo" value="{1}"/>
>>>         </map:match>
>>> ...and I see:
>>>     Error while evaluating '{1}' : not so many levels
>>> So what am I not getting?
>>
>>
>> Humm,, with that syntax you are sending the parameter to the matcher.
> 
> 
> D'oh!
> 
> I know exactly what that syntax does when I'm *trying* to do something 
> like that :-)
> 
>>  Are you actually trying to send the parameter to a generator?
>>
> 
> No, I'm not.  What I really wanted to do was to capture one of the 
> matches into a parameter that I could then reference later on.
> 
> For one thing, I was confusing 'parameter' a la <map:parameter> with the 
> parameters in the Map object returned by matchers and actions...
> 
> But is there a way to do what I was trying to do?

What *are* you trying to do? "Capture one of the matches into a 
parameter" is your solution to your problem. But what's your problem?

Please don't feel offended, but again I must say you are thinking a 
programming way, but the sitemap is declarative. It just does not work 
this way.

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "not so many levels" error?

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 14, 2004, at 3:03 PM, Tony Collen wrote:

> Mark Lundquist wrote:
>> Dear All,
>> I have this (verbatim) in my sitemap:
>>         <map:match pattern="*">
>>           <map:parameter name="foo" value="{1}"/>
>>         </map:match>
>> ...and I see:
>>     Error while evaluating '{1}' : not so many levels
>> So what am I not getting?
>
> Humm,, with that syntax you are sending the parameter to the matcher.

D'oh!

I know exactly what that syntax does when I'm *trying* to do something 
like that :-)

>  Are you actually trying to send the parameter to a generator?
>

No, I'm not.  What I really wanted to do was to capture one of the 
matches into a parameter that I could then reference later on.

For one thing, I was confusing 'parameter' a la <map:parameter> with 
the parameters in the Map object returned by matchers and actions...

But is there a way to do what I was trying to do?

thanks,
~ML


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "not so many levels" error?

Posted by Tony Collen <co...@umn.edu>.
Mark Lundquist wrote:
> Dear All,
> 
> I have this (verbatim) in my sitemap:
> 
>         <map:match pattern="*">
>           <map:parameter name="foo" value="{1}"/>
>         </map:match>
> 
> ...and I see:
> 
>     Error while evaluating '{1}' : not so many levels
> 
> So what am I not getting?

Humm,, with that syntax you are sending the parameter to the matcher. 
Are you actually trying to send the parameter to a generator?

<map:match pattern="*">
   <map:generate src="bar">
      <map:parameter name="foo" value="{1}"/>
   </map:generate>
   <map:transform src="sadf/qwert.xsl"/>
   <map:serialize/>
</map:match>

Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org