velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akshay Kapur <aka...@cisco.com>
Subject Fwd: Macros defined Inline and #parse
Date Tue, 01 Apr 2003 23:44:08 GMT
Correction: By compile time in my previous mail(as forwarded below), I had 
meant to say "parse-time". Apologize for the confusion caused if any.

Also, I just subscribed to this list after I sent the mail, I may have 
potentially missed your response. In that case, I will appreciate if you 
could resend it.

Regards
Akshay

>Date: Tue, 01 Apr 2003 15:15:16 -0800
>To: velocity-user@jakarta.apache.org
>From: Akshay Kapur <akapur@cisco.com>
>Subject: Macros defined Inline and #parse
>
>Hello
>
>There is a scenario wherein a parent.vm #parses a child.vm(which contains 
>a macro definition and it's invocation). The config property 
>velocimacro.permissions.allow.inline.local.scope is set to false. The 
>child.vm is parsed properly and the macro correctly executes too.
>However, when I set this property to true, the macro doesn't get invoked.
>
>Now I have read the Velocity users guide which explains that macros are 
>loaded into memory at compile time and since #parse command is executed at 
>run-time, the macros defined inline in a #parsed file don't get loaded at all.
>
>My question is why does switching the above mentioned config property to 
>false make the whole thing work??!! Why do the inline macros get loaded in 
>the first place when the rules for compile-time/ run-time should be the 
>same irrespective of the switch?
>
>Thanks
>Akshay
>
>
>--Structure of the above mentioned files is depicted below --
>
>parent.vm
>...
>#parse( "child.vm" )
>...
><< EOF >>
>
>*******************
>
>child.vm
>...
>#macro ( print )
>..I was defined in included file!!!
>#end
>...
>#print()
><< EOF >>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message