>>
>>At http://localhost:8888/samples/blocks/proxy/wsproxy/
>>org.apache.cocoon.sitemap.PatternException: Evaluation error in expression: 
>>http://{request:serverName}:{request:serverPort}{request:contextPath}
>> �
>>
>
>Can you apply the attached patch, to your Cocoon source, and see if it 
>fixes it. Simple, but should work.
Applied.

>My Cocoon setup is broken a present as I'm working on something else.
>
>Let me know. If it works, I'll commit it.
>
>Upayavira
Sorry, it is only a partial fix to for the PatternException.

I've the same problem when accessing global
variable definitions like

 <map:pipelines>
  <map:component-configurations>
    <global-variables>
       <!--+
           | Define global parameters here:
           | You can access them by {global:*name*}, e.g. {global:skin}.
           | These values are inherited into sub-sitemaps and can
           | be extended there.
           +-->
          <hwhost>test</hwhost>
          <hwport>418</hwport>    
    </global-variables>
  </map:component-configurations>

...

</map:pipelines>

and accessing them with
 src="hyperwave://{global:hwhost}:{global:hwport}"

I've done a little debugging in PreparedVariableResolver.resolve():

After parsing this src line stack.size == 3

with 

Token 0: type=EXPR, value=hyperwave://test
Token 1: type=COLON, value=null
Token 2: type=EXPR, value=418

The bug is in the that colons only appear between
{input_module:value} and not outside of it.
The fix is to create tokens of type TEXT with value ":" for colons
outside an module reference.

The attached patch works for me with my sitemap and seems to work
for the proxy block, too.


-- 
lg, Chris
--- PreparedVariableResolver.java.orig	2004-04-14 13:42:11.000000000 +0200
+++ PreparedVariableResolver.java	2004-04-14 13:29:43.000000000 +0200
@@ -140,6 +140,7 @@
                     if (lastTokenType != PREFIXED_SITEMAP_VAR &&
                         lastTokenType != ANCHOR_VAR &&
                         lastTokenType != THREADSAFE_MODULE &&
+                        lastTokenType != CLOSE &&
                         lastTokenType != STATEFUL_MODULE) {
                             continue;
                     }
@@ -151,7 +152,12 @@
                 if (i> pos) {
                     tokens.add(new Token(expr.substring(pos, i)));
                 }
+                if (openCount != closeCount) {
                 tokens.add(COLON_TOKEN);
+                } else {
+                  // this colon isn't part of a module reference 
+                  tokens.add(new Token(TEXT, ":"));
+                }
                 pos=i+1;
             }
         }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to